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

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back

5 Common Misconceptions About AI Coding Tools and Why They Hold You Back As a solo founder or indie hacker, you might be considering leveraging AI coding tools to boost your produc

Oct 7, 20264 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning

5 Common Misconceptions About AI Coding Tools That Will Hurt Your Learning As a beginner in coding, diving into the world of AI coding tools can feel like stepping into a futuristi

Oct 6, 20263 min read
Ai Coding Tools

10 AI Coding Tools Beginners Overlook in 2026

10 AI Coding Tools Beginners Overlook in 2026 As a beginner in coding, diving into the vast ocean of AI tools can feel overwhelming. While flashy tools often grab the spotlight, ma

Oct 6, 20265 min read
Ai Coding Tools

5 Common Misconceptions About AI Coding Tools That Beginners Believe

5 Common Misconceptions About AI Coding Tools That Beginners Believe As a solo founder or indie hacker, diving into the world of AI coding tools can feel overwhelming, especially i

Oct 5, 20263 min read
Ai Coding Tools

5 Mistakes Every Beginner Makes When Using AI Coding Tools

5 Mistakes Every Beginner Makes When Using AI Coding Tools As a solo founder or indie hacker diving into the world of AI coding tools, it’s easy to get swept up in the excitement o

Oct 4, 20264 min read
Ai Coding Tools

10 Common Misconceptions About AI Coding Tools in 2026

10 Common Misconceptions About AI Coding Tools in 2026 As we dive into 2026, AI coding tools have become a staple in the developer toolkit. However, misconceptions still run rampan

Oct 4, 20264 min read