Prompt Engineering Basics That Actually Work

Tutorial · Prompting · 8 minute read

Most prompt advice is superstition dressed up as technique. After years of daily use, four habits account for nearly all of the difference between frustrating and reliable results: be specific, show examples, structure the request, and iterate on failures instead of starting over.

1. Be specific about the output, not just the topic

"Write about databases" gives the model a topic and nothing else, so it guesses at length, audience, and format — and its guesses are averages. Compare: "Write a 150-word explanation of database indexes for a junior developer who knows SQL but has never tuned a query. Use one concrete example." Every constraint you add removes a guess. Audience, length, format, and one example are the four constraints that matter most.

2. Show, don't just tell

Two or three examples of the input/output pattern you want — called few-shot prompting — beat paragraphs of abstract instruction. Models are pattern machines; a pattern they can see is worth more than a rule they must interpret. Keep examples consistent in format, and make the last example the closest to your real case.

3. Structure the request

Separate context, instruction, and data. Markdown headers, delimiters, or simple labels all work:

## Context
Our support team answers ~200 tickets a day.

## Task
Draft a reply to the ticket below. Friendly, under 80 words,
no promises about refund timelines.

## Ticket
[paste here]

Structure also helps you: when an answer goes wrong, you can see which part to fix.

4. Iterate on the failure, not the whole prompt

When output disappoints, name the single worst problem — too long, wrong tone, invented facts, wrong format — and add one instruction targeting exactly that. Rewriting the whole prompt each time destroys the parts that were already working and teaches you nothing about which change helped.

A note on "magic phrases"

There are no magic words. Phrases like "think step by step" help on reasoning tasks because they change the computation the model performs — it writes intermediate steps it can then use. That is a mechanism, not an incantation, and it does nothing for tasks with no reasoning to externalize. Prefer understanding the mechanism; it generalizes, and incantations do not.