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.
Hook: By the end of this guide you’ll have GitHub Copilot installed and typing 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. Perfect for anyone who needs to write code but isn’t a full-time developer.
- A free GitHub account (sign-up takes 30 seconds).
- A free Microsoft (or GitHub) account.
- Visual Studio Code installed on your computer.
Install the Copilot extension
Open VS Code, click the square icon on the left (Extensions), type “Copilot” and pick the one called GitHub Copilot. Click Install. When it finishes, you’ll see a new Copilot icon in the Activity bar.
Sign in with your GitHub account
Click the Copilot icon in the Activity bar, then click “Sign in to GitHub”. A browser window opens; sign in with the same account you used to create your GitHub account. When you see “Copilot is ready,” close the browser and return to VS Code.
Turn on the AI helper
In VS Code, open any folder or just create a new empty folder. Inside that folder create a file named hello.py. VS Code will ask if you want to install recommended extensions; say Yes.
Ask Copilot to write your first line
With hello.py open, type the single line:
# write a function that prints hello world
Press Enter. After a second you’ll see grey ghost text appear right after your cursor. That’s Copilot suggesting code. Press Tab to accept it, then press F5 to run the file. You should see “Hello, world!” in the terminal.
Ask for a tiny project
Create a new file called greet.py and type:
# create a function that greets a person by name
Accept the suggestion, then add one more line under it:
greet("Alex")
Save the file and run it. You now have a working mini-program that didn’t require you to write most of the code yourself.
- Signing in with the wrong account: Copilot only works if you use the same account you used to buy or enable Copilot.
- Blocking pop-ups: If the sign-in window never appears, check your browser’s pop-up blocker.
- Waiting too long: If Copilot feels slow, close other apps; it uses a bit of internet bandwidth.
- Accepting bad suggestions: Always read the ghost text before you press Tab; you can delete it and try again.
Open VS Code, create a file called test.py, type # create a function that adds two numbers, accept the suggestion, and run it. You just wrote—and ran—your first AI-assisted code in under two minutes.
✦ Original step-by-step guide by AI World Co.'s AI editorial team. Written in plain language, reviewed for accuracy.
← Back to all stories