Prompt Engineering for Beginners: 12 Techniques That Actually Work
You do not need a magic formula to get good answers from an LLM. You need structure, context and a way to verify the output. These 12 techniques cover all three.
There is a persistent myth that prompt engineering is a secret language of magic phrases. It is not. Great prompts are built from a small set of repeatable techniques that give a model context, structure and a way to be checked.
1. Give the model a role and a goal
Start by telling the model who it is and what success looks like. "You are a senior editor. Rewrite the following paragraph for a general audience, keeping it under 100 words." The role narrows the space of possible responses; the goal defines the finish line.
2. Provide context before the question
Models answer better when they know the background. State the audience, the tone, the constraints and the purpose. Context given up front shapes every subsequent token.
3. Use few-shot examples
One example is worth a thousand instructions. Show the model an input and the output you expect, then ask for the next one. This is called few-shot prompting and it often beats elaborate instructions.
Convert product names to slugs:
"AI Writer Pro" → "ai-writer-pro"
"Hello, World 2.0" → "hello-world-2-0"
"Agent Runner" →
4. Ask for step-by-step reasoning
When you need accuracy, ask the model to reason out loud before giving a final answer. This is chain-of-thought prompting. "Work through this step by step, then give a final answer." The intermediate steps keep the model honest.
5. Specify the output format
Do not leave the format to chance. Ask for JSON, a table, a bulleted list, or a specific length. "Return a JSON object with keys name, price, and summary." Models comply with explicit format requests reliably.
6. Use negative instructions sparingly
Saying "do not mention X" works less well than telling the model what to include. If you must exclude something, phrase it as an instruction: "Only discuss verified facts and say 'unknown' otherwise."
7. Break complex tasks into steps
Ask the model to perform one operation at a time. Instead of "summarise and translate and extract quotes", ask it to summarise first, then translate, then extract. Each step gets its own chance to be correct.
8. Ask the model to ask questions
When the task is underspecified, tell the model to ask for clarification first. "Ask me up to three clarifying questions before answering." This turns a guessing model into a careful one.
9. Constrain with delimiters
Wrap the user-supplied text in clear markers so the model knows what is content versus instruction. Triple backticks, XML tags or all-caps labels all work. This also reduces prompt injection risk when you insert outside text.
10. Give it an escape hatch
Always let the model say "I don't know". "If the information is not in the provided sources, reply: 'Not available in the sources.'" You trade a little fluency for a lot of honesty.
11. Iterate on output, not just input
Treat the first response as a draft. "Good, now make it 30% shorter", "more formal", "add a concrete example". Editing the output is cheaper and more controllable than re-engineering the prompt.
12. Build a small evaluation set
Collect ten representative inputs with good expected outputs. When you change a prompt, run it against the set. This turns prompt tweaking from vibes into measurement — and it is the single biggest upgrade most people can make.
The best prompt engineers are not more creative. They are more precise about what they ask for and more rigorous about checking what they get.
A quick recap
Taken together, this guide is organised around the core ideas below, and each one matters for a different reason.
- 1. Give the model a role and a goal — Start by telling the model who it is and what success looks like.
- 2. Provide context before the question — Models answer better when they know the background.
- 3. Use few-shot examples — One example is worth a thousand instructions.
- 4. Ask for step-by-step reasoning — When you need accuracy, ask the model to reason out loud before giving a final answer.
- 5. Specify the output format — Do not leave the format to chance.
Questions worth asking yourself
Use these prompts to turn the article into decisions about your own setup.
- How does 1. Give the model a role and a goal apply to the way you approach prompt engineering techniques today?
- How does 2. Provide context before the question apply to the way you approach prompt engineering techniques today?
- How does 3. Use few-shot examples apply to the way you approach prompt engineering techniques today?
- How does 4. Ask for step-by-step reasoning apply to the way you approach prompt engineering techniques today?
Putting it into practice
Applying prompt engineering techniques is less about memorising every feature and more about building a repeatable routine. Start with the single task that costs you the most time each week, run it through the workflow described above, and keep a short note of what changed. Your own results are a better guide than any generic benchmark. The same principles show up wherever you work with ChatGPT, Claude, Prompting.
The Prompt Engineering landscape moves quickly, so treat what you have read as a starting point rather than a fixed rulebook. Revisit the tools and techniques you rely on every few months, retire anything that no longer earns its place, and fold in only the additions that solve a problem you actually have.
Further reading
If this Prompt Engineering topic was useful, these related guides go deeper on the areas you are most likely to need next.
Written by
Alex Morgan
Alex has spent a decade building software and five years writing about it. At AIComets they focus on prompt engineering, AI agents and honest product testing.
More articles by Alex Morgan →Frequently asked questions
How long does it take to read this article?
Most readers finish in under ten minutes. Use the table of contents to jump to the section you need.
Do I need previous experience to follow along?
No. We explain every concept as it appears, and the code examples are self-contained.