Read More on Telerik Blogs
March 05, 2026 AI
Get A Free Trial

Learn what prompt engineering is and how to create prompts so AI is best able to help you.

Artificial intelligence … artificial intelligence … it’s a term you hear several times a day, I’m sure. But why is it everywhere?

In recent years, we’ve seen huge growth in tools powered by artificial intelligence (AI) that have transformed the way we work. Today, we can complete tasks much faster and more efficiently with AI, which allows us to focus on other important tasks: thinking, creating and making better decisions.

But … How Do These AI Tools Work? 🤔

Even though artificial intelligence may seem like “magic,” it actually needs a guide that provides clear and precise instructions in order to achieve the desired goal. In these instructions, we specify everything from the role the AI should take on as an approach, to the details and conditions of what we want, and even the format in which we want the result—all of this so our objective is 100% fulfilled.

This is what we call a prompt. No matter the AI tool, they all need a prompt to start!

Therefore, the key to getting the most out of AI is having a GOOD prompt.

Learning how to create a prompt with the correct structure is essential, since otherwise you won’t achieve the desired result or you’ll need to iterate more times in order to reach your goal. That’s why, in this article, I’ll teach you—based on my experience—the structure I recommend for a good prompt, along with some additional tips.

What Is Prompt Engineering?

Prompt engineering is the art or technique of designing, writing and structuring clear, optimal and as specific as possible instructions (prompts) for artificial intelligence models. Its goal is to guide the model’s reasoning by defining the context, roles and necessary details, in order to obtain responses that are as aligned as possible with our objective.

Let’s Talk About the Importance of a Good Prompt

This is something I always use as an example in my event talks. Imagine your sister asks you to please go buy tomato sauce at the supermarket. You go to the supermarket, but when you arrive, you realize that tomato sauce comes in different presentations: large cans, small ones, sachets, crushed, chunky, from different brands. And then you reealize that your sister, in her instruction (prompt), never told you the type of sauce, the brand or the quantity.

Therefore, you’ll have to call your sister to ask her all of this, or even worse, if your sister doesn’t have a phone, you would have to go back and ask her in person. That call or that extra trip could have been avoided if your sister’s initial prompt had been more specific.

While going back to your sister’s house and then returning to the supermarket achieves the same result as if she had told you everything from the beginning, you had to go through a longer and more exhausting process to get there. This is the difference between a good prompt and one that is not well defined.

The exact same thing happens with artificial intelligence models: an unclear prompt doesn’t prevent you from reaching a result, but it does increase the number of iterations, the time invested and the amount of resources required to achieve it.

Prompt engineering is a practice anyone who’s using AI is constantly refining and developing. You become a better prompt engineer with practice. But let me help you get started advancing!

Structure of an Effective Prompt

From my experience in a fully professional context—and based on what has worked very well for me—a good prompt is composed of four key parts. These parts provide artificial intelligence with the context it needs to respond in the most precise and goal-aligned way possible.

These are:

Let’s look at this structure in more detail:

1. Context / Role

This part of the prompt defines the perspective from which the AI should respond. This role provides a clear focus on the type of knowledge the model should adopt.

This is extremely important to help you avoid receiving responses that do not align with your reality. For example, when we talk about architecture, a software developer understands it as system design (layers, services, patterns and communication flows), while a civil engineer interprets architecture as the structural design of a building (blueprints, materials and construction standards).

If the role is not defined from the beginning, the AI may respond correctly, but from a context completely different from the one expected.

Example: You are a software architect with experience designing scalable backend architectures.

2. Objective / Task

In this part, you define what you want the AI to do, as specifically as possible. The more clarity and detail you provide, the more aligned the results will be with your expectations.

Example: I need you to design a high-level backend system architecture for a web application and explain the main components and their responsibilities.

✍️ I recommend reading and rereading this part as many times as necessary until it is 100% aligned with the message you want to convey.

3. Details / Conditions

In this section, you specify in greater depth what you need: requirements, constraints, style, target audience, level of depth or any other relevant condition.

Example: The architecture explanation should be tailored for a development team, using technical terminology, and focusing on backend components, responsibilities, system interactions, and high-level architectural decisions, without diving into implementation-specific code.

4. Output Format

Finally, you indicate how you want to receive the response.

Example: Return the response in a structured JSON format.

If we summarize all of this in a visual diagram, a simple example would look like the following:

❌ Common Mistakes When Creating Prompts

Being too vague: Yes, avoid being vague. 😅 Don’t write a prompt just “to get it done quickly.” Add context and purpose, and make it clear to avoid constantly reworking it and wasting time on unnecessary iterations.

Asking for too many things at once: Break the task into steps. Personally, I like to structure it this way so the main objective of the message doesn’t get lost and to give the AI enough time to understand what it should do and what it shouldn’t.

(For example, if you’re building a complete app, don’t ask for the entire thing at once—ask for it in parts, starting with the login, then the profile screen and so on.)

Providing contradictory information: This is a fairly common mistake. Avoid mixing opposite instructions (for example: “be brief, but explain it in detail”), as this creates confusion in the response.

And always, always remember to review your prompt before sending it.

How to Handle AI Responses

💡 Finally, I’d like to leave you with a few recommendations for what to do with the results.

  • Understand the code: Don’t copy and paste it without analyzing it first.
  • Review the logic: Make sure you understand what each line does and why it exists.
  • Evaluate whether it can be improved: The code may work, but it can still use unnecessary resources or fail to follow best practices.
  • Guide the AI: The clearer and more precise your instructions are, the better and more efficient the results will be.
  • Don’t rely entirely on AI: Use it to learn and accelerate your work, NOT to stop thinking.

Conclusion

And that’s it! 🎉 In this article, you explored what prompt engineering is and why it plays such a critical role when working with AI models. From understanding the importance of defining a clear context and role, to structuring objectives, details and output formats.

You also learned why vague instructions, contradictory requirements or trying to do everything at once can lead to unnecessary iterations, wasted time and higher resource consumption—and how a clear, structured prompt helps avoid all of that.

Now you have a good foundation to start creating more effective prompts, reduce friction when working with AI, and get results that are truly aligned with your goals. Remember: AI is a powerful tool, but its effectiveness depends largely on how well you guide it.

If you have any questions or want me to cover more related topics, feel free to leave a comment—I’d be happy to help you! 💚


For more getting-started content in AI, stay tuned to our AI Crash Course series. Here are the first couple posts:


AI
About the Author

Leomaris Reyes

Leomaris Reyes is a Software Engineer from the Dominican Republic, with more than 5 years of experience. A Xamarin Certified Mobile Developer, she is also the founder of  Stemelle, an entity that works with software developers, training and mentoring with a main goal of including women in Tech. Leomaris really loves learning new things! 💚💕 You can follow her: Twitter, LinkedIn , AskXammy and Medium.

Related Posts