Prompt Engineering for Beginners (Part 2): The Anatomy of a Good Prompt
Part 1 of our Prompt Engineering from Scratch series, we explored how AI generates answers, what tokens and context windows are, and why the way we communicate with AI matters. We learned one important lesson: Getting better results from AI isn't always about using a more powerful model. Sometimes,

Part 1 of our Prompt Engineering from Scratch series, we explored how AI generates answers, what tokens and context windows are, and why the way we communicate with AI matters.
Getting better results from AI isn't always about using a more powerful model. Sometimes, it's about giving clearer instructions.
But knowing that we should write better prompts is one thing.
What information should we include? How specific should our instructions be? And how do we know whether our prompt is good enough?
That's exactly what we'll explore in Part 2.
We'll break down six useful components of a well-structured prompt, understand what each one does, and learn how to combine them using simple, real-life examples.
No complicated terminology. No programming knowledge required.
In Part 2, we'll learn the six useful building blocks of a good prompt, how to combine them, and how to test whether our prompts are working.
And don't worry. You don't need any technical background.
Let's begin with something we all understand.
Imagine you're asking a friend to help you write an email.
Your friend would probably have a few questions.
Without that information, your friend has to guess.
Write an email asking for leave. Enter fullscreen mode Exit fullscreen mode The AI might produce an email, but it doesn't know important details.
Write a professional email to my manager requesting two days of leave. I need leave on Monday and Tuesday because of a family commitment. Keep the email polite and under 120 words. Include a subject line. Enter fullscreen mode Exit fullscreen mode This is much clearer.
You've given the AI the information it needs to create a more suitable response.
And that's the foundation of a good prompt.
A good prompt doesn't need complicated words. It needs clear instructions and enough relevant information.
When writing a prompt, there are six useful components you can think about.
These components help you explain what you need, how you want the task completed, and what the final answer should look like.
These six components provide a useful framework for writing clear prompts.
But here's something important: you don't need all six components every time.
For more complicated tasks, such as analyzing a document or writing a detailed report, additional information becomes more valuable.
The goal isn't to make every prompt longer.
The goal is to make every prompt clear enough for its purpose.
Imagine you're asking someone for advice.
If you need help preparing for an exam, you might ask a teacher.
If you need help improving your writing, you might ask an editor.
If you need help planning a trip, you might ask a travel guide.
Different roles suggest different ways of approaching a task.
You can use a similar idea when prompting AI.
Help me improve this paragraph. Enter fullscreen mode Exit fullscreen mode With a role Act as a friendly writing tutor. Help me improve this paragraph using simple English. Explain what you changed and why. Enter fullscreen mode Exit fullscreen mode The second prompt gives the AI a clearer direction.
It suggests the type of assistance and explanation you want.
You might hear the technical term system prompt.
In many AI applications, a system message contains higher-level instructions about how the assistant should behave.
For example, an application might instruct its AI assistant to use a particular language or follow certain rules.
into a normal chat, you're generally giving a role instruction as a user, not changing the application's actual system message.
You don't need to access system settings to use role-based prompting.
And a role doesn't give the model magical expertise or guarantee accurate answers.
It simply helps guide how the model approaches and presents the task.
When you want a particular style of help, such as teaching, editing, planning, or reviewing.
Without knowing the situation, it's difficult to give useful advice.
Context is the background information that helps AI understand your situation or task.
Write an email requesting leave. Enter fullscreen mode Exit fullscreen mode With context I'm an employee writing to my manager. I need two days of leave on Monday and Tuesday because of a family commitment. My manager prefers short and professional emails. Enter fullscreen mode Exit fullscreen mode Now the AI knows more about your situation.
It can use that information when preparing the email.
Imagine you're asking AI to recommend a laptop.
Recommend a laptop. Enter fullscreen mode Exit fullscreen mode Prompt with context:
I'm a university student. I mainly use my laptop for online classes, writing assignments, browsing, and watching videos. My budget is around $600. Recommend suitable laptops and explain why they would fit my needs. Enter fullscreen mode Exit fullscreen mode The second prompt gives the model a much clearer picture of what you're looking for.
Imagine asking someone to help you choose a laptop, then telling them your entire life story.
Most of that information wouldn't help them.
Provide the background details that matter for the task, and avoid including unnecessary personal or sensitive information.
Good context means relevant information, not simply more information.
Sometimes it's easier to show someone what you want than to explain it.
Imagine you're asking a friend to design an invitation card.
Instead of describing every detail, you might show an example and say:
AI can also use examples to understand the pattern, style, or structure you expect.
Rewrite this message professionally. Enter fullscreen mode Exit fullscreen mode With an example Rewrite my message in a professional but friendly tone. Example: Original: "Hey, send me the report." Improved: "Could you please send me the report when you have a chance?" Now rewrite this message: "I need the meeting details." Enter fullscreen mode Exit fullscreen mode The example demonstrates the kind of change you want.
It shows the AI how to make a request sound more polite without changing its meaning.
These are two terms you might encounter.
Zero-shot prompting means asking the AI to perform a task without providing examples.
Rewrite this sentence professionally: "Send me the file." Enter fullscreen mode Exit fullscreen mode Few-shot prompting means providing one or more examples before asking the AI to perform the task.
Example 1: "Send me the file." → "Could you please send me the file?" Example 2: "Call me tomorrow." → "Could you please call me tomorrow?" Now rewrite: "Give me the document." Enter fullscreen mode Exit fullscreen mode The examples help demonstrate the pattern.
However, examples aren't always necessary, and they don't automatically work better than clear instructions.
For simple tasks, a direct instruction may be enough.
We'll explore zero-shot and few-shot prompting in more detail in Part 3.
When you want a specific writing style, structure, classification, or repeated pattern.
This is one of the most important parts of a prompt.
The task tells the AI what it should actually do.
It sounds obvious, but vague tasks can lead to vague answers.
Help me with my resume. Enter fullscreen mode Exit fullscreen mode What kind of help?
Review my resume. Identify unclear sentences and suggest improvements. Keep my existing experience and achievements accurate. Do not invent qualifications or work experience. Enter fullscreen mode Exit fullscreen mode Now the AI knows what to focus on.
Summarize this article. Enter fullscreen mode Exit fullscreen mode Clearer:
Summarize this article in five bullet points. Focus on the main findings. Explain any difficult terms in simple English. Enter fullscreen mode Exit fullscreen mode Notice something?
We haven't used complicated technical language.
We've simply explained the task more clearly.
A useful habit: Before sending a prompt, ask yourself:
If someone who had never met me read this instruction, would they understand what I wanted them to do?
If the answer is no, you may need to make the task clearer.
Now imagine you're asking someone to write a short speech.
The problem isn't necessarily the speech itself.
Constraints are the rules or limitations you want the AI to follow.
They help make the output more suitable for your needs.
Write a short speech about teamwork. Rules: - Use simple English. - Keep it under 200 words. - Include one everyday example. - Avoid difficult technical terms. - End with an encouraging message. Enter fullscreen mode Exit fullscreen mode Here, you've made your expectations much clearer.
If you add too many conflicting rules, the AI may struggle to follow them.
Explain this topic in detail using only ten words.
Those instructions work against each other.
So try to keep constraints realistic and relevant.
Remember: Constraints guide the AI, but they don't guarantee that every rule will always be followed.
That's why checking the final answer is still important.
Imagine asking someone to organize your monthly expenses.
They could give you a long paragraph describing everything.
Output format tells the AI how you want the final answer to be organized.
Compare online learning and classroom learning. Enter fullscreen mode Exit fullscreen mode The AI might produce several paragraphs.
Compare online learning and classroom learning. Present the comparison in a table. Include: - Cost - Flexibility - Interaction - Advantages - Disadvantages Finish with a short summary. Enter fullscreen mode Exit fullscreen mode Now the structure is clear.
JSON is a way to organize information using labels and values.
{ "name": "Aarav", "age": 22, "city": "Kathmandu" } Enter fullscreen mode Exit fullscreen mode You don't need to use JSON in everyday prompting.
It's mainly useful when applications or programs need information in a consistent structure.
For most beginners, requesting a paragraph, table, or list is enough.
The takeaway: Choosing the right output format can make an answer easier to read, check, and use.
Now let's combine everything we've learned.
We'll use the same email example from the beginning.
Write an email asking for leave. Enter fullscreen mode Exit fullscreen mode This might work, but it leaves several details unclear.
ROLE: Act as a professional writing assistant. CONTEXT: I'm an employee writing to my manager. I need two days of leave on Monday and Tuesday because of a family commitment. EXAMPLE: Use a polite and professional tone similar to: "I would like to request your approval for two days of leave." TASK: Write an email requesting the leave. CONSTRAINTS: - Keep it under 120 words. - Use simple and professional language. - Do not invent additional personal details. OUTPUT FORMAT: Include: 1. Subject line 2. Greeting 3. Email body 4. Closing Enter fullscreen mode Exit fullscreen mode This prompt gives the AI much clearer instructions.
We've simply organized our instructions.
The same request could be written naturally in a few sentences:
Write a polite email to my manager requesting leave on Monday and Tuesday because of a family commitment. Keep it under 120 words, use simple professional English, and include a subject line.
A well-structured prompt doesn't have to be long or complicated. It just needs to provide the information the task requires.
The six components are a guide, not a rule that every prompt must follow.
Notice that the improved prompts aren't necessarily much longer.
For straightforward tasks, a simple prompt can work perfectly.
For complicated tasks, clear instructions often help.
And sometimes the model may still make mistakes despite having a well-written prompt.
That's why we need a way to test whether our changes actually improve the result.
This example connects closely with my work testing AI models on real documents.
Imagine you upload a 50-page report and type:
Summarize this report. Enter fullscreen mode Exit fullscreen mode The AI might give you a useful general summary.
Your original prompt didn't mention those expectations.
So you might have to ask several follow-up questions.
Now let's try a more structured approach.
ROLE: Act as a research assistant. CONTEXT: I've uploaded a report that I need to understand without reading every page. TASK: Summarize the report. Include: 1. The main purpose of the report. 2. Five important findings. 3. Key financial figures, if available. 4. Major risks or limitations. 5. Important recommendations. CONSTRAINTS: - Use simple English. - Keep the summary under 500 words. - Do not invent missing information. - Clearly mention if something is not found. OUTPUT FORMAT: Use headings and bullet points. Where possible, include page references so I can check the original information. Enter fullscreen mode Exit fullscreen mode This prompt gives the model a clearer structure.
It also makes the output easier to verify.
For example, if the AI reports a financial figure, you can check the page where that figure appears.
Of course, the model could still overlook information or provide an incorrect page reference.
A structured prompt improves clarity and makes verification easier. It doesn't eliminate the need to check important results.
If you're not from a technical background, you can skip this section.
Everything we've learned so far is enough to start improving your prompts.
But if you're curious about how developers use these ideas, here's a simple example.
Write code to calculate the total price. Enter fullscreen mode Exit fullscreen mode The AI doesn't know the programming language, the calculation rules, or how to handle unusual inputs.
ROLE: Act as a Python programming assistant. CONTEXT: I'm building a small shopping application. TASK: Write a function that calculates the total price of products in a shopping cart. CONSTRAINTS: - Each product has a price and quantity. - Reject negative prices or quantities. - Explain the calculation clearly. - Include two example calculations. OUTPUT FORMAT: Return the Python code followed by a short explanation. Enter fullscreen mode Exit fullscreen mode This follows the same six-component idea.
A developer may also provide database information, existing code, error messages, or other technical details.
But the main principle remains the same:
Give the AI enough information to understand the task, and clearly explain how you want the answer.
Generated code still needs to be reviewed and tested before being used in a real application.
Now that we know how to build a prompt, what should we do if the first answer isn't good enough?
Should we keep adding random instructions?
A better approach is to improve the prompt step by step.
I want a short explanation of climate change for a young student.
Don't immediately replace your first prompt.
Explain climate change. Enter fullscreen mode Exit fullscreen mode This is your starting point.
You can compare future versions against it.
In technical settings, saving and tracking changes is sometimes called versioning.
But you don't need special software to do this.
A notebook or text document works perfectly.
Explain climate change to a 12-year-old. Enter fullscreen mode Exit fullscreen mode Now compare the answer with Version 1.
Next, return to Version 1 and test a different change.
Explain climate change in 100 words. Enter fullscreen mode Exit fullscreen mode Now compare again.
This helps you understand whether specifying the audience or limiting the length made the answer more useful.
If you change five things at once, it becomes harder to identify which change helped.
AI responses can vary even when you use the same prompt, so repeat important tests before drawing strong conclusions.
After comparing the results, you can combine useful instructions.
Explain climate change to a 12-year-old. Use simple English. Keep it under 100 words. Include one everyday example. Enter fullscreen mode Exit fullscreen mode You now have a clearer prompt based on what you've learned.
If a prompt works well for a task you repeat often, save it.
Explain [TOPIC] to [AUDIENCE]. Use simple language. Keep the explanation under [WORD LIMIT]. Include [NUMBER] everyday examples. Enter fullscreen mode Exit fullscreen mode You can replace the words inside the brackets whenever you need to use the template again.
This is one of the practical benefits of prompt engineering.
Instead of starting from scratch every time, you build a collection of instructions that you can reuse and improve.
In professional applications, teams may also track prompt versions, run repeated tests, compare results, and monitor performance after releasing an AI feature.
But for beginners, the same idea starts with something much simpler:
Keep your original prompt, change one thing, and check what happens.
Before sending an important prompt, ask yourself:
You don't have to check every box for every question.
Make a study plan for me. Enter fullscreen mode Exit fullscreen mode Read the answer.
Does it know what subject you're studying?
I'm a student preparing for an exam next week. I can study for two hours every day. Make a study plan for me. Enter fullscreen mode Exit fullscreen mode Compare the result with your first answer.
I'm a student preparing for an exam next week. I can study for two hours every day. Create a seven-day study plan. Include short breaks. Keep the activities realistic. Enter fullscreen mode Exit fullscreen mode Step 4: Specify the output format I'm a student preparing for an exam next week. I can study for two hours every day. Create a seven-day study plan. Include short breaks. Present the plan in a table with: - Day - Study topic - Duration - Activity Enter fullscreen mode Exit fullscreen mode Notice how the prompt becomes more specific.
You've simply made your expectations clearer.
Which instruction changed the answer, and did that change make it more useful?
That's the habit I want you to develop throughout this series.
Here's everything we've learned in one table.
You don't need all six components for every prompt.
A simple question can have a simple prompt.
A complicated task may need more detail.
The purpose of prompt engineering isn't to make communication complicated.
In Part 3, we'll explore six useful prompting techniques:
We'll explain each one using practical examples and discuss when it might be useful.
In Part 1, we learned that language models don't automatically know what we expect from them.
Today, we learned how to communicate those expectations more clearly.
A good prompt isn't measured by how long or complicated it is. It's measured by how clearly it communicates the task and how useful the result is.
You don't need to memorize complicated terms.
And you certainly don't need a programming background.
That's how you begin developing a prompt-engineering mindset.
What's one task you regularly ask AI to help you with?
Writing emails? Studying? Summarizing documents? Planning your day?
Share your basic prompt in the comments, and let's see how we can improve it using the six components.
This is Part 2 of 6 in my "Prompt Engineering from Scratch" series. I work with and test open-source AI models on real documents, and I'm sharing what I learn along the way.
Follow the series if you'd like to understand AI and learn practical prompting techniques, one step at a time.