Ai Coding Tools

How to Use GitHub Copilot to Write Your First 10 Lines of Code in 30 Minutes

By BTW Team3 min read

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

In short

An easy-to-follow tutorial guiding beginners through the initial steps of using GitHub Copilot to write basic code snippets efficiently.

If you’re a beginner looking to dip your toes into coding, GitHub Copilot could be a game-changer for you. But let’s be honest: diving into coding can feel overwhelming, especially when you’re staring at a blank screen. The good news? You can write your first 10 lines of code in just 30 minutes using Copilot, and I’m here to walk you through it.

Prerequisites: What You Need to Get Started

Before you start, make sure you have the following:

  1. A GitHub Account: If you don’t have one yet, sign up for free at GitHub.
  2. Visual Studio Code (VS Code): Download and install it from here.
  3. GitHub Copilot Subscription: It costs $10/month after a 60-day free trial. You can sign up directly in VS Code after installation.

Step 1: Set Up Your Environment (5 Minutes)

  1. Open Visual Studio Code.

  2. Install the GitHub Copilot Extension:

    • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
    • Search for "GitHub Copilot" and click "Install."
  3. Log into GitHub:

    • After installation, you’ll need to log in to your GitHub account through the extension.

Step 2: Create a New File (5 Minutes)

  1. Create a New File:

    • Click on File > New File or press Ctrl + N.
    • Save the file with a .js extension (e.g., hello.js).
  2. Start Typing:

    • Begin by typing a simple comment like // This program prints "Hello, World!". Copilot will automatically suggest code based on your comment.

Step 3: Let Copilot Do Its Magic (10 Minutes)

  1. Type Your Intent:

    • After the comment, type console.log( and let Copilot fill in the rest. You should see suggestions pop up. Hit Tab to accept the suggestion.
  2. Write Additional Lines:

    • To create a simple program, you can type:
      // This program adds two numbers
      const a = 5;
      const b = 10;
      console.log(a + b);
      
  3. Review and Modify:

    • Make sure to review the generated code. You can modify it to fit your needs or preferences. Copilot is great, but it's not perfect.

Expected Output

After following the steps, your hello.js file should look something like this:

// This program prints "Hello, World!"
console.log("Hello, World!");

// This program adds two numbers
const a = 5;
const b = 10;
console.log(a + b);

Troubleshooting: What Could Go Wrong

  • No Suggestions: If you don’t see any suggestions from Copilot, make sure the extension is properly installed and you are connected to the internet.
  • Inaccurate Code: Sometimes, Copilot may generate code that doesn't work as expected. Always run your code to check for errors.

What’s Next?

Once you’ve successfully written your first 10 lines of code, consider the following steps:

  1. Experiment: Modify the numbers or add more console logs to get familiar with coding concepts.
  2. Learn More: Check out online resources or courses on JavaScript to expand your knowledge.
  3. Join Communities: Engage with other beginners on forums like Stack Overflow or Reddit’s r/learnprogramming.

Conclusion: Start Here

If you’re a beginner, GitHub Copilot is a fantastic tool to help you get started with coding. With just 30 minutes and a few simple steps, you can write your first lines of code and see how coding works in practice. Don’t hesitate to explore and experiment—coding is all about learning through doing.

To get the most out of Copilot, remember that it’s a tool to assist you, not replace fundamental learning. As you grow more comfortable with coding, you’ll find that understanding the underlying concepts will make you a much better developer.

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