Getting started with GitHub Copilot: a beginner's guide
Learn how to let AI write code for you safely, right inside your editor, so you can finish small projects faster.
This guide was written by AI. It passed automated fact and quality checks, and our editor spot-checks published guides every day.
See AI World HQ first on GoogleAdd us as a preferred source and our stories show up higher in Google’s Top Stories.Add on GoogleBy the end of this guide, you’ll have GitHub Copilot installed and ready to type real code for you inside Visual Studio Code. You'll try it on a tiny "hello world" file, so you can see the magic without risk. This is perfect for anyone in a business or work setting who needs to write a bit of code but isn't a full-time developer.
💡 Tip: tap a step’s number when you finish it — a green tick appears and your browser remembers how far you got.
- A free GitHub account: This is an online account that helps you manage code projects. Signing up is quick, usually under a minute.
- A GitHub Copilot subscription: After a free trial, Copilot requires a paid subscription. You’ll need to ensure you have an active subscription or are within your trial period to use it.
- Visual Studio Code (VS Code) installed: This is a free code editor where Copilot lives. Download it from the official website and install it on your computer (Windows, Mac, or Linux).
- Time needed: Allow about 10-15 minutes to follow all the steps.
- No active Copilot subscription or trial: Copilot is a paid service after a free trial, and it won't work without an active subscription linked to your GitHub account.
- Fix: Ensure your GitHub Copilot subscription is active by visiting the GitHub Copilot settings page in your browser.
- Copilot suggestions aren't appearing: Sometimes Copilot needs a moment to 'wake up', or there might be an issue with your internet connection or VS Code configuration.
- Fix: Wait a few seconds after typing your prompt. Check the Copilot icon in the VS Code status bar (bottom right); if it's spinning or shows an error, try restarting VS Code or checking your internet connection.
- Blindly accepting suggestions: Copilot provides suggestions, but they might not always be exactly what you need, or they could contain minor errors.
- Fix: Always read the ghost text carefully before pressing
Tab. If it's not quite right, you can ignore it by continuing to type, or delete it and rephrase your comment to guide Copilot towards a better answer.
- Fix: Always read the ghost text carefully before pressing
Open VS Code, create a new file named calculate.py. Inside it, type # create a function that adds two numbers and returns the sum, then press Enter. Accept Copilot's suggestion, then add a line like result = add_numbers(5, 3) and print(result). Save the file, press F5 to run it, and see the result in the terminal. You just wrote – and ran – your first AI-assisted functional code in under two minutes!
❓ Quick questions
How long does this take?
About 6 minutes — the guide has 5 steps, and you can tick each one off as you go.
Which tool do I need?
This guide uses GitHub Copilot — but the approach works very similarly in other AI assistants.
Do I need to prepare anything?
- A free GitHub account: This is an online account that helps you manage code projects. Signing up is quick, usually under a minute.
- A GitHub Copilot subscription: After a free trial, Copilot requires a paid subscription. You’ll need to ensure you have an active subscription or are within your trial period to use it.
- Visual Studio Code (VS Code) installed: This is a free code editor where Copilot lives. Download it from the official website and install it on your computer (Windows, Mac, or Linux).
- Time needed: Allow about 10-15 minutes to follow all the steps.
What mistakes should I avoid?
- No active Copilot subscription or trial: Copilot is a paid service after a free trial, and it won't work without an active subscription linked to your GitHub account.
- Fix: Ensure your GitHub Copilot subscription is active by visiting the GitHub Copilot settings page in your browser.
- Copilot suggestions aren't appearing: Sometimes Copilot needs a moment to 'wake up', or there might be an issue with your internet connection or VS Code configuration.
- Fix: Wait a few seconds after typing your prompt. Check the Copilot icon in the VS Code status bar (bottom right); if it's spinning or shows an error, try restarting VS Code or checking your internet connection.
- Blindly accepting suggestions: Copilot provides suggestions, but they might not always be exactly what you need, or they could contain minor errors.
- Fix: Always read the ghost text carefully before pressing
Tab. If it's not quite right, you can ignore it by continuing to type, or delete it and rephrase your comment to guide Copilot towards a better answer.
- Fix: Always read the ghost text carefully before pressing
Keep reading
✦ Generated by AI in AI World HQ's automated newsroom, written in plain language. Checked by automated fact and quality gates, and our editor spot-checks published guides every day. Spot a mistake? Use the buttons above.
📘 Prefer it in one file? First Steps with AI: The Beginner Pack (20 guides, free printable PDF)
← Back to all stories