How to Write Effective AI Prompts: Your Prompt Engineering Guide for Better Results
Bridget Amana

Bridget Amana @bridget_amana

About: Just a curious frontend developer learning in public

Location:
Lagos, Nigeria
Joined:
Jun 27, 2024

How to Write Effective AI Prompts: Your Prompt Engineering Guide for Better Results

Publish Date: Jun 16
4 1

In the world of AI, what you get is based on what you ask. If your input is clear and specific, the output is likely to be useful and on point. But if the input is vague or confusing, don’t be surprised if the answer feels off.

A good prompt helps you get the most out of tools like ChatGPT, Claude, or any other AI assistant. Whether you're a writer, developer, marketer, or small business owner, learning to write effective prompts can save you time and frustration.

Why Prompts Matter

AI isn't human. It doesn’t read between the lines or make assumptions like people do. It responds to what you give it, so when your prompt lacks detail, it can only work with what it has.

Let’s say you type "help me with marketing" The AI might list random tactics. But tell it, "I run a local bakery and need ways to attract more customers" and you’ll get advice that fits your situation.

Prompting well makes the difference between generic results and helpful, relevant output.

Simple Steps to Write Strong AI Prompts

To get good answers from AI every time, focus on these basic steps when you write your prompts:

1. Be Clear About What You Want

If you ask a general question, you'll get a general answer. Instead, say exactly what you need. Be very clear about your goal.

Instead of:
"How do I fix my computer?"

Try:
"My laptop is making a strange beeping sound when I turn it on. What are the first two things I should check?"

Instead of:
"List birthday presents for a kid."

Try:
"What are five fun birthday presents for a 6-year-old girl who loves Disney princesses?"

2. Give Important Details (Context)

Sharing details helps the AI give you useful answers. Tell it what it needs to know about your situation. The more background info you provide, the better the AI can tailor its response to your specific situation. Without these details, you might get advice that's irrelevant to your needs.

Example: "I'm a busy freelancer with very little free time. What are two effective 20-minute exercises I can do daily at home with no equipment?"

3. Tell It How to Answer (Format)

Tell the AI how you want the answer to look. Do you need a step-by-step list? Just a simple list? A full explanation? When you tell the AI the format, it gives you the information in the best way for you to use.

Example: "Make a table that shows the good and bad points of renting versus buying a house."

4. Show Examples if They Help

Sometimes, showing the AI what you want helps a lot. Give it examples of the style or tone you like.

Example: "Write a nice but firm email to say no to this job offer because I got a better one. Keep the same polite and thankful tone as this sample email: (put your example email text here)"

5. Set Clear Limits (Rules)

Tell the AI any rules or limits it needs to follow. This helps it stay within what you want.

Example: "Suggest three indoor hobbies I can start that is budget-friendly."

6. Tell It What Not to Do

Just as important as telling the AI what you want is telling it what you don't want. This helps it avoid irrelevant information or unwanted styles, giving you a more precise and useful answer.

Instead of: "Tell me about famous landmarks in Paris."

Try: "List five famous landmarks in Paris, do not include the Eiffel Tower"

Advanced Prompt Optimization Tips

Once you've mastered the building blocks, these advanced strategies will help you unlock more exact and powerful results from your AI conversations.

1. Ask It to Take on a Role (Persona Prompting)

Having the AI respond as a specific type of expert often significantly improves the quality, depth, and relevance of its advice. This is a core prompt engineering technique.

Examples:
"As a hiring manager, what are the top three things you look for in a resume for an entry-level marketing job?"

"As a certified fitness trainer, design a 20-minute bodyweight workout routine"

2. Break Big Questions into Smaller Parts

Complex problems or ambitious tasks work better when split into manageable, sequential steps. This prevents the AI from becoming overwhelmed and provides more structured, accurate outputs.

Instead of: "Help me plan my career change from accounting to graphic design, including skills, timeline, and financial planning."

Try: "I'm thinking about changing careers from accounting to graphic design. First, what are the essential skills I need to develop, and how can I acquire them efficiently? Once we've covered that, we can discuss timelines and financial planning."

3. Ask for Step-by-Step Thinking (Chain-of-Thought Prompting)

For complex problems that require reasoning, request detailed reasoning or a step-by-step breakdown of the AI's thought process. This can improve accuracy and help you understand the logic.

Example: "Walk me through how to decide whether I should repair my 10-year-old car or buy a new one. Show me what factors to consider and how to weigh them to make an informed financial decision."

4. Build on Previous Answers (Conversational Iteration)

Don't treat each question as separate. Generative AI models are conversational. Build upon previous responses, asking follow-up questions to refine, deepen, or modify the initial output. This iterative approach is key to prompt optimization.

Follow-up examples:
"That's helpful. Can you give me specific examples of each point you mentioned?"

"Now, make those suggestions work for someone with a $500 monthly budget instead."

5. Iterate and Refine Your Prompts

Don't expect perfection on the first try. View prompt writing as an iterative process. If the initial response isn't quite right, analyze why and adjust your prompt. This might mean adding more context, refining constraints, clarifying your intent, or even changing the persona.

Common Mistakes in Crafting AI Prompts

While striving for effective prompts, be mindful of these common pitfalls:

  1. Being Too General: Asking a general question is like casting a wide net; you might catch something, but it's probably not what you're looking for. The more specific you are, the better the AI can understand your needs and give you truly helpful answers.

  2. Leaving Out Important Details: Don't assume the AI knows your situation. Always include relevant information about your experience level, budget, time constraints, target audience, or other factors that significantly affect the desired answer.

  3. Giving Up Too Quick: The first response might not be perfect. Embrace the iterative process. Ask follow-up questions, refine your prompt, or specify what was missing or incorrect to guide the AI towards exactly what you need.

  4. Overloading with Unnecessary Information: While context is good, avoid including irrelevant details that don't contribute to the core of your request. Share relevant details, but don't include your entire life story when asking for recipe suggestions.

Remember, while AI tools are powerful, they are not perfect. They can sometimes generate incorrect or nonsensical information, a term known as Hallucinations Always verify the AI's output, especially for factual content. Additionally, be aware that their knowledge base is not always current, meaning they may lack information on very recent developments.

Comments 1 total

  • Notification
    NotificationJun 16, 2025

    Hey everyone! We’re launching DEV Contributor rewards for all verified Dev.to authors. Visit the claim page here to see if you qualify (wallet connection required). – Dev.to Team

Add comment