Two people can ask the same AI the same thing and get wildly different answers — and the difference is almost always the prompt. Prompt engineering sounds technical, but it is really just the habit of writing a clear, well-structured request and then improving it. This guide breaks it down for beginners: what a good prompt contains, a handful of techniques that help, a before-and-after rewrite, and the one 2026 change that means some old advice no longer applies.

What Is Prompt Engineering?

Prompt engineering is the practice of designing and refining the input you give an AI model so it produces the output you actually want. It is not a secret code — it is closer to briefing a capable assistant. Every major AI vendor publishes its own prompting guidance, and they agree on the fundamentals, which is what this article synthesises.

The vendor guidance converges on a simple loop: define what a good answer looks like, find a way to test against that (even by hand), write a first-draft prompt, and then iterate. Anthropic frames the starting point exactly this way. The point is that prompting is a cycle, not a one-shot attempt — you rarely get the best result on the first try, and that is normal.

how to write better ai prompts A prompt card annotated with five labelled parts — role, task, context, format and example. Placement: under H2 "The Anatomy of a Good Prompt".

The Anatomy of a Good Prompt

Before reaching for clever tricks, get the structure right. Microsoft’s guidance lists the building blocks of a prompt as instructions, primary content, examples, a cue, and supporting content. In plain language, a solid prompt usually contains three things:

  • An instruction — the task, stated clearly and specifically.
  • Context — the background the model needs: who it is for, what it is for, any facts it should use.
  • A desired format — the shape of the answer you want: a table, a bulleted list, three options, under 200 words, and so on.

Adding examples of the output you want (more on this below) and a short cue — a nudge like “here is the summary:” — pushes quality up further. None of this is exotic; it is the same detail you would give a colleague before asking them to write something.

Zero-Shot, One-Shot, and Few-Shot Prompting

These three terms describe how many examples you give the model, and they are the fastest way to raise output quality.

  • Zero-shot: you give instructions with no examples. Fast, but the model guesses at the format and style you want.
  • One-shot: you include a single example of the output you want. This anchors the format immediately.
  • Few-shot: you include several examples. Best when the task is specific or the pattern matters — for example, three sample product descriptions in your house style.

A handy rule of thumb: if you find yourself correcting the same thing twice, stop re-explaining it and paste one good example instead.

Beginner Techniques That Improve Almost Any Prompt

The following techniques appear across the major vendors’ guidance. They are things to try and refine, not guaranteed tricks.

  1. Be clear and specific. Vague asks get vague answers. Say exactly what you want.
  2. Give it a role. Framing the model as “a patient tutor” or “an experienced editor” (Anthropic calls this role prompting) shapes tone and depth.
  3. Use delimiters. Separate instructions from content with clear markers — headings, blank lines, quotes or tags — so the model does not confuse the two.
  4. Break big tasks into smaller steps. Instead of “write my report,” ask for an outline, then a draft section by section.
  5. Specify the output format. Ask for bullets, a table, JSON, or a numbered list. Structure is one of the easiest quality wins.
  6. Repeat the key instruction at the end. For long prompts, restating the main goal last helps the model keep it in view.
  7. Ask for reasoning when it helps. For a maths problem or a decision, inviting the model to work through its reasoning (a “step by step” request) can improve the answer — with one 2026 caveat below.
  8. Ground it in your context. Paste the actual facts, document, or data you want it to use, rather than relying on what it remembers.
  9. Ask for sources or caveats. Where accuracy matters, ask the model to flag uncertainty or cite where a claim comes from.
  10. Iterate. Treat the first answer as a draft. Say what is wrong and ask for a revision.

A grid of ten icons representing beginner prompt techniques such as being specific, giving a role, adding examples and iterating. Placement: under H2 "Beginner Techniques That Improve Almost Any Prompt

The 2026 Caveat: Reasoning Models Need Less Hand-Holding

This is the most important recent change for anyone learning to prompt. Newer “reasoning” AI models — the ones designed to think through a problem before answering — behave differently from earlier chat models.

Microsoft’s guidance notes that many of the classic techniques above, especially coaching the model to “think step by step”, are not recommended for reasoning models, because those models already work through problems internally. In practice this means: on a modern reasoning model, focus on giving clear goals, context, and constraints, and let the model handle the reasoning itself. On older or lighter models, the step-by-step coaching still helps. If you are unsure which kind of model you are using, try the prompt both ways and keep what works better.

A Before-and-After Rewrite Example

Here is a weak prompt and a rewritten version. (This example is our own, written for this article.)

Weak prompt: “Write about email marketing.”

Better prompt: “You are a marketing writer for a small online store that sells handmade candles. Write a short email to existing customers launching a new autumn scent line. Tone: warm and down-to-earth, not salesy. Structure: a friendly subject line, a two-sentence intro, a three-bullet list of the new scents, and a single call-to-action sentence linking to the shop. Keep the whole email under 150 words. Here is an example of the tone we like: ‘[paste one past email]’.”

Nothing in the second prompt is advanced. It simply states the role, the task, the context (small store, existing customers), the tone, the format, the length, and an example. That is the whole method.

A split illustration contrasting heavy step-by-step coaching with a reasoning model that answers cleanly on its own. Placement: under H2 "The 2026 Caveat: Reasoning Models Need Less Hand-Holding

An Iteration Loop: Define Success, Test, Refine

Because prompting is a cycle, a reliable workflow pays off more than any single trick. Before you type anything, decide what a good answer looks like. Then write a first attempt and judge it honestly against that standard. Then change one thing at a time — a clearer instruction, an example, a tighter format — and compare. Keeping one variable at a time is what makes it obvious which change helped.

Common Prompt Mistakes and How to Fix Them

  • Being vague (“make it better”) — say what “better” means: shorter, more formal, more concrete.
  • Burying the ask. Put the main instruction where it is easy to see, and repeat it at the end for long prompts.
  • No format specified. If you want a table, ask for a table.
  • Assuming it knows your context. It does not know your business, your data, or yesterday’s conversation unless you provide it.
  • Accepting the first answer. The first response is a starting point; ask for a revision.
  • Cramming five tasks into one prompt. Split them, or chain them as separate steps.

Prompting Different AI Tools

The fundamentals travel across tools, but each vendor offers its own structuring features. OpenAI’s guidance demonstrates prompts built around a clear task, context, format, and examples. Google Cloud’s prompt-design strategies cover system instructions, few-shot examples, structuring the prompt, and adding contextual information. Anthropic highlights wrapping sections in simple tags, role prompting, giving the model room to reason, and chaining prompts as sequential steps. You do not need to learn all of these at once — the general anatomy in this article works everywhere, and vendor-specific features are optional refinements. Tool interfaces and model names change frequently, so always check the current documentation for the version you use.

FAQ

What is prompt engineering in simple terms?

It is the skill of writing and refining the instructions you give an AI so it produces the result you want — closer to writing a clear brief than to programming.

Do I need examples in every prompt?

No. Zero-shot prompts work for simple tasks. Add one or more examples (one-shot or few-shot) when the format or style matters and the model keeps missing it.

Does “think step by step” still help?

It can help on lighter or non-reasoning models, but vendor guidance says it is generally not needed on newer reasoning models, which reason on their own. Test it if you are unsure.

Why did the same prompt give a different answer the second time?

AI outputs vary, so a prompt is a request, not a fixed button. Tighten the format and constraints, and iterate, to get more consistent results.

Final Thoughts

Better prompts come from the same habits as better briefs: be specific, give context, show an example, say what format you want, and refine. Start with one prompt you use often, rewrite it using the anatomy above, and compare the results. For the tools to point those prompts at, see our related guides below.

Sources

Related Guides on Dhanutech