Prompt engineering basics: how to write prompts that work
Most "the AI gave me garbage" moments are really prompting problems. You don't need tricks or magic words — you need to communicate the task the way you'd brief a sharp but literal-minded contractor. Here are the fundamentals that reliably improve output, from someone who has to ship results, not win prompt-golf.
State the task, the context, and the format
Vague in, vague out. A strong prompt names three things: what you want done, the context the model needs to do it, and the exact shape of the output. "Write something about onboarding" gets mush; "Write a 5-step onboarding email for a B2B analytics tool, friendly but concise, as a bulleted list" gets something usable. The more the model has to guess, the more it will guess wrong.
Give it a role and an audience
Telling the model who it is and who it's writing for narrows its output toward what you actually want. "You are a security reviewer explaining risk to a non-technical manager" produces different (better-targeted) text than no framing at all. Role and audience are cheap to add and consistently raise relevance — they constrain tone, depth, and vocabulary in one line.
Show an example of what "good" looks like
One concrete example often beats a paragraph of instructions. If you want a specific structure, paste a sample (this is "few-shot" prompting). Models are excellent at pattern-matching, so a single well-chosen example of the input-output you want pins down format, tone, and level of detail far more precisely than describing them. For tricky formats, two or three examples are better still.
Break big asks into steps
Complex tasks fail when crammed into one prompt. Split them: outline first, then draft each section; extract the data, then analyze it. For reasoning-heavy problems, asking the model to "work through it step by step" before giving a final answer measurably improves accuracy on math and logic. Treat a hard task as a short conversation, not a single command.
Constrain, then iterate
Add the guardrails that matter: length limits, things to avoid, required sections, the reading level. Then treat the first output as a draft — tell the model what to change ("shorter, drop the intro, make point 3 concrete") rather than starting over. Iterating on a near-miss is faster than re-rolling and hoping. Save prompts that work; a small personal library beats reinventing the brief each time.
Know prompting's limits
Prompting can't make a model know something it doesn't, stop it from hallucinating entirely, or substitute for giving it the right data. If you keep fighting a prompt, the problem may be the wrong model for the task or missing context, not your wording. Prompting is how you get the most out of a capable model — not how you paper over the wrong one.