Menu

Prompt Engineering: A Practical Guide for Beginners

Learn to write clearer prompts with real before-and-after examples, a simple prompt structure, few-shot prompting, and an honest look at the limits.

A prompt is just the message you type into an AI tool. Prompt engineering sounds technical, but for most people it comes down to one skill: explaining what you want clearly enough that a model with no background on your situation can do it well.

OpenAI describes it as writing instructions so that a model consistently produces what you need. There are no magic words. The same habits that make a request clear to a new coworker make it clear to a chatbot.

If you’re new here, AI 101: Key Concepts for Beginners explains what a language model is actually doing when it answers you. That background makes this guide easier to follow.

The parts of a clear prompt

Most good prompts are built from the same few parts. You won’t need all of them for a quick question, but the more a task matters, the more of them you’ll want.

prompt structure1 2
Figure 1. The five parts of a clear prompt, with an example.
  • Context: the background the model can’t guess. Who you are, who the result is for, what has already happened.
  • Task: one clear instruction. “Write,” “summarize,” “compare,” “list,” “rewrite.”
  • Constraints: the limits. Length, tone, audience, what must be included and what to leave out.
  • Output format: the shape of the answer. A table, five bullet points, an email with a subject line, a short paragraph.
  • Examples (optional): one or more samples of what a good answer looks like. Examples can help produce a consistent format, and we’ll come back to them below.

A vague prompt vs. a clear one

Here is a request most people have typed at some point.

Prompt:

Write an email to my landlord about the heater.

Response (shortened):

Subject: Heater Issue

Dear [Landlord’s Name],

I hope this message finds you well. I am writing to inform you about an issue with the heater in my apartment. It does not seem to be working properly. I would appreciate it if you could arrange for someone to take a look at it at your earliest convenience.

Best regards,

[Your Name]

Nothing in that answer is wrong. It’s just generic, because the prompt was. The model doesn’t know when the heater broke, whether you’ve already reported it or how urgent it is, so it fills the gaps with polite filler and placeholders.

Now the same request with context, a clear task, constraints and a format:

Prompt:

I rent an apartment. The heater stopped working completely on Sunday night, and it’s about 58°F inside. I called my landlord on Monday and haven’t heard back.

Write an email to my landlord asking for a repair visit by Friday.

Tone: polite but firm. Keep it under 120 words. Mention the Monday call and that I’m available any weekday after 4 p.m.

Start with a subject line, then the email. No placeholders except my name at the end.

Response:

Subject: Heater not working since Sunday, repair needed by Friday

Hello,

The heater in my apartment stopped working completely on Sunday night, and the indoor temperature is now around 58°F. I reported this by phone on Monday but haven’t received a response yet.

Could you please arrange a repair visit by Friday? I’m available any weekday after 4 p.m. and happy to work around the technician’s schedule.

Please let me know when to expect someone.

Thank you,

[Your name]

The second email is more specific and ready to send. The model didn’t get smarter between the two attempts. It got better information.

(The example responses in this article were generated with Claude in November 2026 and lightly shortened. If you try the same prompts, you’ll get different wording each time, which is normal.)

Zero-shot and few-shot prompting

These two terms come up constantly, and they’re simpler than they sound. Google’s prompting guide puts it this way: a prompt with no examples is a zero-shot prompt, and a prompt that includes a few examples is a few-shot prompt. Few-shot learning is an older concept, but a 2020 research paper on GPT-3 helped popularize few-shot prompting by demonstrating how language models can perform tasks with a handful of examples in the prompt.

Say you run a small online store (the same phone-accessories store from our AI vs. Machine Learning vs. Data Science article) and you want to sort customer reviews so you can count them in a spreadsheet.

Zero-shot prompt:

Sort these customer reviews into categories:

1. “The case cracked after two weeks.”

2. “Arrived a day late but the charger works great.”

3. “Is this cable compatible with the new iPad?”

Response:

1. Product quality issue

2. Mixed: shipping delay, positive product feedback

3. Pre-purchase question

That’s a reasonable answer, but the labels are made up on the spot. Run it again with new reviews and you may get different label names, which makes consistent counting harder.

Few-shot prompt:

Label each review with exactly one of: PRODUCT, SHIPPING, QUESTION, PRAISE. Reply only in the format “number: LABEL”.

Review: “Screen protector had bubbles everywhere.” → PRODUCT

Review: “Package took three weeks to arrive.” → SHIPPING

Review: “Does this come in black?” → QUESTION

Now label these:

1. “The case cracked after two weeks.”

2. “Arrived a day late but the charger works great.”

3. “Is this cable compatible with the new iPad?”

Response:

1: PRODUCT

2: SHIPPING

3: QUESTION

This response uses the requested labels and format. The second prompt changed two things: it fixed the list of allowed labels and supplied examples. Together, those changes can improve consistency, but neither guarantees it. Spot-check the results, especially ambiguous reviews. Notice the trade-off on review 2, though: it’s partly about shipping and partly praise, and the prompt forced a single label. If you’d rather allow two labels, say so in the prompt. Examples help guide the format, but you still have to decide what counts as the right answer.

Use few-shot prompts when examples can clarify the desired format, style or task: labels, data extraction, product descriptions in your house style, replies in a set tone. For a one-off question, zero-shot is usually fine.

Habits that make a real difference

Use the new-coworker test. Anthropic’s prompting documentation has recommended imagining that you’re handing the prompt to a capable colleague who knows nothing about your situation. If they’d need to ask questions before starting, the model needs that information too.

Explain why, not just what. “Keep it short” works. “Keep it short because I’ll read it on my phone between meetings” works better, because the model can apply the reason to choices you didn’t think to mention.

Let the model ask first. For bigger tasks, end your prompt with: “Before you start, ask me up to three questions about anything that’s unclear.” You’ll often discover what you forgot to say.

Break big jobs into steps. Instead of “write my business plan,” ask for an outline first, fix it, then ask for one section at a time. Each step is easier to check.

Treat the first answer as a draft. You don’t need the perfect prompt on the first try. Follow-ups like “make it half as long,” “less formal” or “the second point is wrong, here’s why” are normal and effective.

What better prompts can’t fix

A clear prompt improves your chances of a useful answer. It doesn’t guarantee a correct one.

Models can still be confidently wrong. OpenAI’s own researchers have explained that language models are often rewarded for guessing rather than admitting they don’t know, which is one reason they produce plausible-sounding false answers. Telling a model “say ‘I don’t know’ if you’re not sure” can help, but it doesn’t remove the problem.

Be especially careful with sources. Asking for “three studies that prove this” can produce citations that look real but don’t exist. Use AI to find leads, then open every source yourself before you rely on it.

The model only knows what you tell it, plus its training. It can’t see your files, your email or last week’s news unless the tool you’re using has been given that access.

Results vary. The same prompt can give different answers each time. For anything important, run it more than once or check the answer against another source.

Mind what you paste in. Don’t put passwords, financial details or other people’s private information into a chatbot, and check your tool’s privacy settings.

A prompt template you can reuse

Copy this, fill in the brackets and delete any line you don’t need:

Context: I am [who you are]. This is for [who will read or use it]. [Anything that has already happened.]

Task: [One clear instruction.]

Constraints: [Length.] [Tone.] Include [must-haves]. Avoid [things to leave out].

Format: [Bullets / table / email / paragraph], [any order or sections].

Examples: [Optional: one or two samples of a good answer.]

If anything is unclear, ask me before you start.

Where to go next

This completes the three-part Start Here path. If you skipped ahead, AI 101 covers how models learn and why they make mistakes, and AI vs. Machine Learning vs. Data Science explains how the fields fit together.

The best way to get better at prompting is practice. Pick one task you do every week, write a prompt for it using the template above, and adjust it each time until the first answer is good enough to use.

Sources

Checked as of November 26, 2026.

Get Edgelyst Updates

Subscribe for new AI articles, practical guides, and learning resources.