Ai Coding Tools

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

By BTW Team4 min read

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

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!

Follow Our Building Journey

Weekly podcast episodes on tools we're testing, products we're shipping, and lessons from building in public.

Subscribe

Never miss an episode

Subscribe to Built This Week for weekly insights on AI tools, product building, and startup lessons from Ryz Labs.

Subscribe
Ai Coding Tools

How to Increase Coding Speed by 50% with AI Tools in 30 Days

How to Increase Coding Speed by 50% with AI Tools in 30 Days If you're a solo founder, indie hacker, or side project builder, you probably know the struggle of writing code quickly

Jul 13, 20264 min read
Ai Coding Tools

How to Double Your Coding Speed Using GitHub Copilot in Just 2 Hours

How to Double Your Coding Speed Using GitHub Copilot in Just 2 Hours If you're a solo founder or indie hacker, you know that time is your most valuable resource. You're constantly

Jul 13, 20264 min read
Ai Coding Tools

Lovable vs Bolt.new: Which AI Tool is Better for Rapid Prototyping?

Lovable vs Bolt.new: Which AI Tool is Better for Rapid Prototyping? When you're building a product, rapid prototyping is crucial. It allows you to test ideas quickly without sinkin

Jul 13, 20264 min read
Ai Coding Tools

How to Build a Simple Web App Using AI Coding Assistants in Just 2 Hours

How to Build a Simple Web App Using AI Coding Assistants in Just 2 Hours Building a web app can feel daunting, especially for indie hackers and solo founders strapped for time. But

Jul 13, 20264 min read
Ai Coding Tools

Boost Your Coding Efficiency: How to Automate Tests with AI in 2 Hours

Boost Your Coding Efficiency: How to Automate Tests with AI in 2026 If you're a solo founder or indie hacker, you know that testing can eat up a lot of your time. Writing tests man

Jul 13, 20264 min read
Ai Coding Tools

Cursor vs GitHub Copilot: Which AI Tool Offers Better Support for Intermediate Developers?

Cursor vs GitHub Copilot: Which AI Tool Offers Better Support for Intermediate Developers? As an intermediate developer, you’re likely navigating the fine line between being comfor

Jul 13, 20263 min read