What Is a Prompt, and How Do You Write a Good One? Prompt Writing in 4 Steps
AI answer not what you wanted? Often the prompt is the problem, not the model. Four steps, role, context, example and format, give you a precise prompt.
By: Milad Ebrahimpour5 min read

Key points
- A weak answer very often comes from a vague prompt, not from the model itself.
- A good prompt has four steps: role and goal, context, example and answer format.
- The first answer is a draft. You can improve it with precise feedback.
- The model sometimes adds something you did not say; check the answer before you use it.
In this article
Is the AI's answer not what you wanted? Very often the problem is not the model, it is the prompt. In this post you will learn how to write a prompt in four simple steps: role, context, example and format. By the end you will be able to write a precise prompt for any job, from an email to a video script.
This post is the written version of part two of the “AI Fundamentals” series. The full video is here. The video lesson is recorded in Persian, with an English audio track on YouTube. If you have not read part one, start with How does AI work?
One model, two prompts, two completely different answers
Let's start with an example. Two people have the same job to do: they need to email their client to say the project will be delivered late. Both get help from the same AI. The first person writes one sentence, the second writes four lines.
The first answer is a generic email, and you still have to write half of it yourself. The second answer is ready to send. The model was the same; the difference was in what they told it, which is the prompt.
What is a prompt, and why does it matter so much?
A prompt is anything you give the model to build its answer from: a question, an instruction, a piece of text, a file, even an image.
Why does it matter so much? Because language models build the answer word by word, and they choose each word based on the text that came before it. The first piece of that text is your prompt. So everything you write sets the direction of the whole answer.
The model is like a clever employee on their first day
A simple way to think about it: imagine the model as a very clever employee whose first day at work is today. They know a lot, but they know nothing about you. They do not know your client, or your project, or what this email is supposed to do for you. Whatever you do not tell them, they guess, and the guess is usually an ordinary answer for an ordinary person.
Step 1: Role and goal
The first thing: tell it what role it is working in. When you write “You are an experienced project manager”, the model picks up the tone and way of thinking of that person. An experienced project manager knows that in an email like this, you need to offer a solution more than an apology.
Then state your goal. What is this email supposed to do? Just pass on the news, or keep the client's trust? When the goal is clear, the model knows what to emphasise.
Step 2: Context
The second thing, and probably the most important, is context. The model cannot read your mind. Things that are obvious to you do not exist for the model unless you write them down:
- What is the client's name?
- What is the project?
- What was the old date and what is the new date?
- Why is it late?
- If something is going to be offered to make up for it, what exactly?
When you write these down, the same gaps that were in the first answer get filled in, because this time the model did not have to guess.
A simple rule: if a real person would need a piece of information to do this job, the model needs it too.
Step 3: Examples, or few-shot prompting
The third thing: instead of explaining what you want, show it.
Take a different job. You want to write a short script for a video introducing your product. You could explain that it should be short, fast-paced, and that every scene should have a visual and text. But some things are hard to get across by explaining, such as rhythm, tone or writing style.
The easier way is to put a sample in front of it. The model picks up the pattern of the sample and carries on with the rest in the same way. One sample shows the pattern; two or three samples make the pattern more precise. This method is called few-shot, which means showing what you want with a few samples.
Step 4: Answer format
The fourth thing: say what shape you want the answer in. How long should it be? Formal or casual? What sections should it have?
The same goes for the script. You can say “Give it to me in a table, with columns for time, visual and text”. If you do not state the format, the model picks one itself, and that format is usually not the one you need.
The first answer is a draft
A common mistake is to think we have to write the perfect prompt the first time. You do not. Treat the first answer as a draft and then improve it:
- “Make the last sentence warmer.”
- “Put the new date at the start of the email.”
- “Make it a bit shorter.”
The model has the whole conversation in view, so it only changes the piece you asked for.
Watch out: the model sometimes adds something you did not say
For example, a discount you were never going to give. So before you send the email, read it carefully yourself once.
The four steps in summary
- Role and goal: say what role the model is working in and what your goal is.
- Context: write down the things only you know.
- Example: if you can, put a sample in front of it.
- Format: say what shape you want the answer in.
Remember those two people at the start of this post? Now you know what was written in those four lines.
An exercise
Take the last prompt you wrote this week, add these four things to it, and compare the two answers.


