Hands type on a laptop at a dark navy desk while a stack of glowing translucent violet blocks rises from the keyboard, the top block clicking into place with a gold spark.
Image generated with Grok AI. See photo credits.

How to Write AI Prompts: A Beginner’s Guide With Examples

A good AI prompt is not a magic phrase. It is a clear handoff, the kind you would give a smart new colleague who knows nothing about your project: what you want, why, what to use, and what the result should look like.

This guide gives you a simple four-part structure that works across ChatGPT, Claude, Gemini and most other assistants, shows before-and-after examples, covers image prompts, and ends with a template you can copy. If you write prompts for coding tools specifically, pair it with our prompt tips for coding agents.

The four parts of a good prompt

Most weak prompts are missing the same things: who it is for, what format is needed, and what “good” means. Official guidance from OpenAI and Anthropic says much the same: be clear and explicit, give the context that matters, and describe the result you want. In practice that comes down to four parts:

  1. Goal: what you want made or done. “Write a 120-word reply to this customer” beats “help with this email”.
  2. Context: the facts the AI cannot guess. Who the audience is, what happened, the source text, your notes.
  3. Output: format, length, tone, structure. “A table with three columns”, “five bullet points”, “plain, friendly English”.
  4. Limits: what must not change or happen. “Keep the prices exactly as written”, “use only the notes below and say if something is missing”, “do not invent quotes”.

You do not need all four every time. A quick question can be one line. For anything you will publish, send or rely on, the four parts save several rounds of fixing.

Before and after examples

Email

Before: “Write an email about the delay.”

After: “Write a short email to customers who ordered the blue backpack. Their delivery is delayed by about a week because of a supplier issue. Tone: calm and apologetic, no excuses. Include the new expected week and a link placeholder for tracking. Under 120 words. Do not offer a discount.”

Summary

Before: “Summarise this.”

After: “Summarise the meeting notes below for a manager who was not there. Put decisions first, then action items with an owner for each. Bullet points, under 150 words. If an action item has no owner, write ‘owner missing’ instead of guessing.”

Learning

Before: “Explain machine learning.”

After: “Explain machine learning to a first-year commerce student in India. Use one everyday example, avoid maths, and end with three questions I can answer to check I understood.” Students can find more ideas in our free AI tools for students guide.

Habits that improve results

How to write image prompts

Image generators respond to visual detail rather than instructions about tone. A reliable order is:

  1. Subject: who or what, doing what. “A small robot watering a plant”.
  2. Setting: where. “On a sunny balcony in a city apartment”.
  3. Style: photo, illustration, 3D render, watercolour, flat vector.
  4. Light and colour: “soft morning light, pastel colours”.
  5. Composition: close-up, wide shot, top-down, aspect ratio such as 16:9.
  6. Exclusions: “no text, no logos” if your tool supports them.

Change one thing at a time between attempts so you learn what each word does. Check each tool’s rules on commercial use before using images in a product; our free tier checklist lists what to look for. You can practise with the image tools in the AI Playground without signing up, and compare generators in our AI image generators guide.

Check the answer before you use it

Even a perfect prompt does not guarantee a correct answer. Language models predict likely text, and likely is not always true; what is an LLM explains why. Before you rely on a result:

A reusable prompt template

# Goal
[What you want made or done, in one sentence.]

# Context
[Audience, background, and any source text or notes.]

# Output
[Format, length, tone, structure. Paste an example if you have one.]

# Limits
[What must not change, what to avoid, and: "If information is missing, say so instead of guessing."]

Before you start, ask me up to three questions if anything important is unclear.

Save it somewhere handy and fill it in for any task that matters. When you are ready to choose an assistant to use it with, browse AI chatbots or read our best AI chatbots roundup, and compare the ones on your short list. If your team needs prompts built into a repeatable business workflow, Contact Here on the homepage.

FAQ

What is prompt engineering?

Prompt engineering is the practice of writing and refining instructions so an AI model gives useful, reliable results. For everyday use it mostly means being clear about the goal, context, format and limits.

Do the same prompts work in ChatGPT, Claude and Gemini?

The same principles work across them. Results differ between models, so test an important prompt in the tool you will actually use and adjust from there.

How long should a prompt be?

As long as it needs to be. A quick question can be one line; a task you will publish or send may need several short paragraphs of context and rules.

Should I use role prompts like “act as an expert”?

A role can help set tone and focus, but it does not add knowledge the model lacks. Clear context and examples usually matter more than the role line.

Why does the AI ignore part of my prompt?

Usually the prompt asks for too many things at once, or the instructions conflict. Split the task, put the most important rule near the end, and check for contradictions.

Sources

About the author

Suraj Kumar builds and edits AIUseFlow, a directory of AI tools for vibe coders, agent builders and creators. Guides like this one walk through a practical workflow with cited sources — not a news wire rewrite. How we rank tools.

Get the weekly stack

Rank movers and new AI tools for builders, once a week. Free, no spam, unsubscribe anytime.