Prompt Engineering Basics: How to Get Better Results From Any AI
Practical tips and techniques for writing better AI prompts, covering specificity, context, few-shot examples, personas, and common mistakes to avoid.

The difference between a mediocre AI response and a great one often comes down to how you ask. Prompt engineering - the art and science of writing effective instructions for AI - is one of the most practical skills you can develop in 2026. The good news is that the basics are straightforward, and they work across every major AI model: ChatGPT, Claude, Gemini, and others.
This guide covers the core techniques that will immediately improve your results.
Why Your Prompts Matter
AI models are powerful but literal. They do exactly what you ask, not what you meant. A vague prompt gets a vague response. A specific, well-structured prompt gets a focused, useful response.
Consider the difference:
Vague prompt: "Tell me about marketing." Result: A generic, unfocused overview that could fill a textbook.
Specific prompt: "I run a small bakery in Portland. Give me 5 practical social media marketing strategies I can implement this week with zero budget." Result: Targeted, actionable advice you can actually use.
The model did not get smarter between those two prompts. You just gave it enough information to be helpful.
Technique 1: Be Specific
The single most impactful improvement you can make is adding specificity. Tell the AI:
- Who you are (your role, expertise level, context)
- What you want (the exact output you need)
- How you want it (format, length, tone, style)
- What it is for (the purpose and audience)
Before: "Write a cover letter." After: "Write a cover letter for a senior software engineer applying to a fintech startup. The role emphasizes Python and distributed systems. My key strengths are 8 years of backend development experience and leading a team that scaled a payment system to 1 million transactions per day. Keep it under 300 words, professional but not stiff."
The second prompt gives the AI everything it needs to produce a useful first draft.
Technique 2: Provide Context
AI models do not know anything about your specific situation unless you tell them. Providing context is free and dramatically improves results.
Useful context to include:
- Background information: "I am a teacher at a middle school. My students are 12-13 years old and have no prior exposure to programming."
- Constraints: "The budget is $500. The timeline is two weeks. The audience speaks both English and Spanish."
- Previous attempts: "I already tried using a dictionary-based approach, but it was too slow for our dataset size."
- Examples of what you like: "I want something in the style of the Stripe documentation - clean, concise, with code examples."
The more relevant context you provide, the less the AI has to guess.
Technique 3: Use Examples (Few-Shot Prompting)
One of the most powerful techniques is showing the AI examples of what you want. This is called "few-shot prompting" because you give a few shots (examples) before asking for the actual output.
Example:
Convert these customer reviews into structured data.
Review: "Great product but shipping took forever. 3 stars."
Output: {"sentiment": "mixed", "pros": ["product quality"], "cons": ["slow shipping"], "rating": 3}
Review: "Absolutely love it! Best purchase I've made all year."
Output: {"sentiment": "positive", "pros": ["overall satisfaction"], "cons": [], "rating": 5}
Review: "Broke after two days. Complete waste of money. Returning immediately."
Output:
By showing the pattern you want, the AI can replicate it accurately. This is especially useful for data transformation, formatting, and any task where the desired output format is specific.
Technique 4: Set a Role or Persona
Telling the AI to adopt a specific role changes the vocabulary, depth, and perspective of its responses.
- "You are an experienced pediatrician explaining vaccination to worried parents." - Produces empathetic, reassuring, medically accurate content.
- "You are a senior Python developer conducting a code review." - Produces technical, precise feedback focused on best practices.
- "You are a financial advisor for small business owners." - Produces practical, business-oriented financial guidance.
The persona primes the model to draw on the most relevant parts of its training. A question about chest pain gets a very different answer from a "medical student" persona versus a "fitness coach" persona.
Technique 5: Break Complex Tasks Into Steps
Large, complex tasks are where AI most often produces mediocre results. The solution is to break them down.
Instead of: "Write a complete marketing plan for my new app."
Try this approach:
"First, help me identify my target audience. My app is a habit tracker designed for busy professionals aged 25-40. What are the key demographics and psychographics I should target?"
"Based on that audience, suggest 5 marketing channels that would be most effective, and explain why."
"Now create a detailed 30-day launch plan using the top 3 channels we identified."
"Write the copy for the first week's social media posts."
Each step builds on the previous one, and you can correct course along the way. This produces far better results than asking for everything at once.
Technique 6: Specify the Output Format
Do not leave the format to chance. Tell the AI exactly how you want the response structured.
Useful format instructions:
- "Respond in a numbered list."
- "Format this as a markdown table with columns for Name, Price, and Pros/Cons."
- "Give me a JSON object with the following fields: title, summary, tags."
- "Keep your response under 200 words."
- "Use bullet points, not paragraphs."
- "Start with a one-sentence summary, then provide details."
Being explicit about format saves you from having to reformat the output yourself.
Technique 7: Iterate and Refine
Great prompts rarely happen on the first try. Treat prompting as a conversation, not a one-shot command.
- If the response is too generic: Add more specific constraints or examples.
- If the response is too long: Ask for a shorter version or set a word limit.
- If the tone is wrong: Specify the tone explicitly ("more casual," "more academic," "write like you are explaining to a friend").
- If it missed something: Say "Good, but also include [missing element]" instead of rewriting your entire prompt.
Each refinement teaches you what the model responds to, making you a better prompt writer over time.
Common Mistakes to Avoid
Being too polite at the expense of clarity. "Could you perhaps, if it's not too much trouble, maybe help me with some writing?" Just say what you need: "Write a 200-word product description for a wireless keyboard targeting remote workers."
Assuming the AI remembers previous conversations. Each new conversation starts fresh (unless the tool explicitly supports memory). Provide all necessary context every time.
Not proofreading AI output. AI models can hallucinate facts, make logical errors, and produce plausible-sounding nonsense. Always review the output critically, especially for factual claims.
Using overly complex prompts when simple ones work. If you need a quick answer, a simple question is fine. Save the elaborate prompting for complex tasks where it matters.
Ignoring the model's strengths. Different models have different strengths. Claude tends to excel at nuanced analysis and writing. GPT-5 is strong at creative tasks. Gemini handles multimodal input well. Play to the model's strengths when you can.
A Quick Prompt Template
When you are unsure how to start, use this template:
Role: [Who the AI should be]
Task: [What you need done]
Context: [Relevant background]
Format: [How you want the output]
Constraints: [Length, tone, what to avoid]
Example:
Role: You are an experienced technical writer.
Task: Write documentation for a REST API endpoint that creates a new user.
Context: The API is for a SaaS project management tool. The audience is frontend developers integrating the API.
Format: Use the same structure as Stripe's API docs - method, endpoint, parameters table, example request and response.
Constraints: Be concise. No more than 500 words. Use cURL for examples.
This template works for almost any task and consistently produces good results.
Start Practicing
The best way to improve at prompting is to practice deliberately. Next time you use an AI tool, pause before hitting Enter and ask yourself: "Is this prompt specific enough? Have I provided context? Do I know what format I want?" Those few seconds of thought will save you minutes of back-and-forth.