Ai Coding Tools

How to Use GitHub Copilot to Write Your First Lines of Code in 3 Hours

By BTW Team4 min read

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

In short

A practical step-by-step guide on how to leverage GitHub Copilot to write and troubleshoot your first code snippets within just three hours.

If you're a beginner looking to write your first lines of code, the prospect can be daunting. You might feel overwhelmed by the sheer amount of information out there and unsure where to start. Enter GitHub Copilot, an AI-powered coding assistant that can help you get up and running in a matter of hours. In this guide, I'll walk you through how to leverage GitHub Copilot effectively to write your first code snippets in just 3 hours.

Prerequisites: What You Need to Get Started

Before diving into GitHub Copilot, make sure you have the following:

  • GitHub Account: Sign up for a free account on GitHub.
  • Visual Studio Code: Download and install VS Code, which is the code editor we'll be using.
  • GitHub Copilot Subscription: GitHub Copilot costs $10/month after a 60-day free trial. This is essential for accessing the AI features.

Once you have these set up, you're ready to start coding!

Step 1: Setting Up Your Environment (30 Minutes)

  1. Install Visual Studio Code: If you haven't installed it yet, head over to the VS Code website and download it for your operating system.

  2. Install GitHub Copilot: In VS Code, go to the Extensions panel (Ctrl+Shift+X), search for "GitHub Copilot," and click "Install".

  3. Sign In to GitHub: After installation, you'll need to sign in to your GitHub account to activate Copilot.

  4. Create a New Project: Open a new folder in VS Code and create a new file (e.g., app.js for JavaScript or script.py for Python). This will be where you write your code.

Step 2: Writing Your First Lines of Code (1 Hour)

Now that everything is set up, it’s time to start coding!

  1. Start with Comments: Type a comment describing what you want to do, like // Create a function to add two numbers. Copilot will suggest code based on that comment. Accept the suggestion by pressing Tab.

  2. Experiment with Different Prompts: Try writing different comments to see how Copilot suggests various implementations. For example:

    • // Create a simple loop that counts to 10
    • // Fetch data from a public API
  3. Accept and Modify Suggestions: Don’t hesitate to tweak the code Copilot provides. It’s a starting point, not the final solution.

  4. Learn by Doing: As you write, take note of the syntax and structures. This will help you understand programming better.

Step 3: Troubleshooting Common Issues (30 Minutes)

While using GitHub Copilot, you may run into some common challenges:

  • Understanding Suggestions: Sometimes the code generated may not make sense. Don't hesitate to Google unfamiliar terms or syntax.

  • Code Errors: If your code doesn’t run as expected, check for common mistakes like missing semicolons or incorrect variable names. Use the built-in debugger in VS Code to help identify issues.

  • Limitations of Copilot: Remember that Copilot is not perfect. It may suggest outdated methods or code that doesn’t align with best practices. Always verify the code it generates.

Step 4: Testing Your Code (30 Minutes)

  1. Run Your Code: Depending on your programming language, you can run your code directly in the terminal in VS Code or use an external tool like Node.js for JavaScript.

  2. Debugging: If there are errors, use the error messages to guide your debugging process. Often, the terminal will indicate what went wrong and where.

  3. Iterate: Don’t be afraid to go back and modify your code based on what you learn during testing. This is part of the coding process!

What’s Next: Building on Your Foundation

After writing your first lines of code, consider the following steps to continue your learning journey:

  • Explore more tutorials: Websites like freeCodeCamp and Codecademy offer structured lessons.
  • Join coding communities: Platforms like Stack Overflow or Reddit’s r/learnprogramming can provide support and feedback.
  • Start a small project: Apply what you've learned by building a simple project. This could be a personal website, a to-do list app, or anything that interests you.

Conclusion: Start Here

If you're a beginner eager to write your first lines of code, using GitHub Copilot is an excellent way to jump in. You can get started in as little as 3 hours by setting up your environment, writing code, and troubleshooting as necessary. Remember, practice makes perfect, and don't hesitate to experiment with different prompts and ideas.

What We Actually Use: We utilize GitHub Copilot for rapid prototyping and learning new programming concepts. While it's not always perfect, it helps us get unstuck quickly.

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