Ai Coding Tools

How to Use GitHub Copilot to Write Code in 2 Hours: A Step-by-Step Guide

By BTW Team4 min read

Comparing tools? See the AI tools tested on the show.

In short

A detailed guide on how beginners can harness GitHub Copilot to write a fully-functional application within just two hours.

If you're a solo founder or indie hacker, you've probably felt the weight of having to code everything yourself. Learning to code can be overwhelming, and let's be honest—sometimes you just want to get things done without spending weeks mastering every language or framework. Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and more efficiently. In this guide, I’ll show you how to set up and use GitHub Copilot in just two hours, so you can start shipping your side projects sooner.

What You’ll Need Before Getting Started

  1. GitHub Account: If you don’t have one, create a free account at GitHub.
  2. Visual Studio Code (VS Code): Download and install VS Code, as Copilot works as an extension within it.
  3. GitHub Copilot Subscription: As of 2026, GitHub Copilot costs $10/month or $100/year after a 30-day free trial.
  4. Basic Understanding of Programming: While Copilot can help you write code, having some foundational knowledge will make it easier to understand the suggestions.

Step 1: Setting Up GitHub Copilot

  1. Install Visual Studio Code: Go to the VS Code download page and install the version for your operating system.

  2. Install GitHub Copilot Extension:

    • Open VS Code.
    • Go to Extensions (or press Ctrl+Shift+X).
    • Search for "GitHub Copilot" and click Install.
  3. Sign in to GitHub: After installing, you’ll be prompted to sign in to your GitHub account. Follow the prompts to authorize Copilot.

  4. Start Your Free Trial: If you haven't subscribed yet, you can start your free trial during the sign-in process.

Step 2: Writing Your First Code with Copilot

Now that you have everything set up, let’s start coding!

  1. Create a New File: In VS Code, create a new file and save it with an appropriate extension (e.g., .js, .py, .html).

  2. Write a Comment: Start by writing a comment that describes what you want to accomplish. For example, if you’re building a simple to-do list, you might write:

    // Function to add a new task to the to-do list
    
  3. Trigger Suggestions: After writing the comment, hit Enter. Copilot will automatically suggest code that matches your comment. If you see a suggestion you like, simply hit Tab to accept it.

  4. Iterate: Continue writing comments for other functions and let Copilot generate code snippets for you. You can refine the suggestions by adjusting your comments to be more specific.

Step 3: Testing Your Code

  1. Run Your Code: Depending on your programming language, you may need to set up a local server or use a terminal to run your code. For example, if you're using Node.js, you can run your script with:

    node yourfile.js
    
  2. Debugging with Copilot: If you run into issues, you can ask Copilot to help debug. For instance, if you encounter an error, write a comment like:

    // Fix the error in the add task function
    
  3. Refine and Optimize: Use Copilot to suggest optimizations. Just write a comment like:

    // Optimize this function to handle multiple tasks
    

Troubleshooting Common Issues

  • Not Getting Suggestions: If Copilot isn’t suggesting code, ensure you’re in a supported file type and that you’re connected to the internet.
  • Incorrect Suggestions: AI isn’t perfect. If you get a suggestion that doesn’t make sense, simply ignore it or refine your prompt.
  • Performance Lag: Sometimes, Copilot can be slow. If you notice lag, try closing other applications or restarting VS Code.

What’s Next?

After you’ve coded a few functions and tested them, consider the following next steps:

  1. Build a Simple Project: Use Copilot to help you build a small project from start to finish.
  2. Explore Advanced Features: Look into Copilot Labs for experimental features that might help you code more efficiently.
  3. Join the Community: Engage with other GitHub Copilot users on forums or GitHub discussions to share tips and tricks.

Conclusion: Start Here

Using GitHub Copilot can significantly speed up your coding process, especially if you're just starting out or looking to build side projects quickly. In about two hours, you can set it up, write some code, and get a feel for how it operates. Remember, while Copilot is powerful, it’s not a replacement for understanding the basics of coding.

With a little bit of practice, you’ll find yourself shipping products faster than ever. So why wait? Get started with GitHub Copilot today!

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools

Watch real AI builds every week

Built This Week is a weekly podcast where Jordan Metzner and Sam Nadler build something real with AI every episode, test new AI tools and talk with founders who build with AI.

See the tools
Ai Coding Tools

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them)

3 AI Coding Tools That Are Overrated (and Why You Should Avoid Them) In the everevolving landscape of AI coding tools, it's easy to get swept up in the hype. As indie hackers and s

Nov 30, 20263 min read
Ai Coding Tools

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026

5 Ways AI Coding Tools Can Accelerate Your MVP Development in 2026 In 2026, the landscape for indie hackers and solo founders has evolved significantly, especially with the advent

Nov 26, 20264 min read
Ai Coding Tools

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026

5 AI Coding Tools That Make Legacy Code Feel Brand New in 2026 If you’re a developer stuck maintaining legacy code, you know the frustration. It’s like navigating a maze blindfolde

Nov 23, 20264 min read
Ai Coding Tools

10 AI Coding Tools That Will Save You Hours of Debugging in 2026

10 AI Coding Tools That Will Save You Hours of Debugging in 2026 Debugging can feel like a neverending cycle of frustration. Whether you're a solo founder or an indie hacker, spend

Nov 18, 20265 min read
Ai Coding Tools

10 Common Mistakes When Using AI Coding Tools for MVP Development

10 Common Mistakes When Using AI Coding Tools for MVP Development As a founder in 2026, you’re likely aware that AI coding tools can significantly speed up the MVP development proc

Nov 16, 20264 min read
Ai Coding Tools

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026

5 AI Coding Myths Every Beginner Developer Should Ditch in 2026 As a beginner developer, you’ve probably come across a ton of buzz surrounding AI coding tools. But with all the hyp

Nov 12, 20263 min read