Prompt Engineering Basics

Learning to communicate effectively with generative models

C

Curated by Rakibul with AI

June 2026 · 8 min read

When you ask an AI model to write a poem or design a game, the quality of its response depends entirely on what you wrote. The words you type are called a 'prompt', and learning to construct these prompts to get the best results is a crucial skill called prompt engineering.

The Structure of a Perfect Prompt

Generative AI models do not read minds; they predict likely sequences of words. If you write a generic prompt like 'write a story,' you will get a generic, boring response.

A well-structured prompt contains four main components: Role (who the AI should act as), Context (the background information), Instruction (what you want it to do), and Output Format (how you want the result styled).

Iterative Refinement

Prompt engineering is an experimental science. If the first answer is not what you wanted, don't start over. Prompt the AI to edit its own output by giving it corrections, such as: 'Remove the second paragraph and make the tone more professional.'

Key Takeaways

  • 1A prompt is the set of inputs or instructions given to an AI system.
  • 2Effective prompts incorporate Roles, Context, Instructions, and Constraints.
  • 3Refining outputs through conversational follow-ups is key to getting high-quality results.

Check Your Understanding

Which prompt is most likely to give a specific, high-quality summary of a text?

Sources & References

  1. "Prompt Engineering Tutorial" · freeCodeCamp (YouTube) · videohttps://www.youtube.com/watch?v=_ZvnD73m40o
  2. "Prompt Engineering Guide" · DAIR.AI · articlehttps://www.promptingguide.ai/
AIFor21stCenturyKids