Ai Coding Tools

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

By BTW Team3 min read

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

Getting into coding can feel overwhelming, especially for beginners. You might be thinking: “How do I even start?” If you’re like many indie hackers or side project builders, you want something that helps you code without having to dive into the deep end of programming languages right away. Enter GitHub Copilot, an AI-powered coding assistant that can help you write code quickly. In this guide, I’ll show you how to leverage GitHub Copilot to write your first piece of code in just 30 minutes.

Prerequisites: What You Need to Get Started

Before we jump in, ensure you have the following:

  • A GitHub account (free)
  • Visual Studio Code (VS Code) installed on your computer
  • GitHub Copilot subscription ($10/month after a 30-day free trial)

Step 1: Set Up Visual Studio Code and GitHub Copilot

  1. Install Visual Studio Code: Download and install VS Code from here.

  2. Sign in to GitHub: Open VS Code and sign in with your GitHub account.

  3. Install the GitHub Copilot Extension:

    • Go to the Extensions view in VS Code (Ctrl+Shift+X).
    • Search for "GitHub Copilot" and click "Install".
  4. Activate Your Copilot Subscription: If you haven’t already, activate your GitHub Copilot subscription. You’ll need to provide payment details after your free trial.

Step 2: Create Your First Project

  1. Create a New Folder: Create a new folder on your computer for your project.

  2. Open the Folder in VS Code: Drag and drop the folder into VS Code or use the "Open Folder" option.

  3. Create a New File: In your project folder, create a new file named hello.js (if you’re using JavaScript).

Step 3: Start Writing Code with GitHub Copilot

  1. Write a Comment: Start by typing a comment describing what you want to do. For example:

    // A function that greets the user
    
  2. Let Copilot Suggest Code: As you type, you’ll notice Copilot suggesting code snippets. Press Tab to accept a suggestion or keep typing to see more options.

  3. Write Your First Function: Here’s an example of what you might end up with:

    function greetUser(name) {
        return `Hello, ${name}!`;
    }
    
  4. Test Your Code: You can add a call to this function:

    console.log(greetUser('World'));
    
  5. Run Your Code: Open the terminal in VS Code (Ctrl+), type node hello.js, and hit Enter. You should see Hello, World!` printed in the console.

Troubleshooting: What Could Go Wrong

  • Copilot Doesn’t Suggest Anything: Make sure you are signed in to GitHub and the extension is enabled.
  • Syntax Errors: If you encounter errors, check the syntax carefully. Copilot can make mistakes, especially if the initial comment is vague.

What's Next: Building on Your Skills

Now that you’ve written your first piece of code, consider the following next steps:

  • Explore Other Languages: Try writing code in Python or Ruby using similar comments.
  • Learn the Basics of JavaScript: Use resources like MDN Web Docs to get a better grasp of JavaScript fundamentals.
  • Build a Small Project: Create a simple web app using your newfound skills.

Conclusion: Start Here

Using GitHub Copilot can dramatically reduce the barrier to entry for coding. In just 30 minutes, you can go from zero to writing your first function. This tool is particularly useful for indie hackers and side project builders who need to prototype quickly without getting bogged down in syntax.

If you’re looking to explore coding further, start with GitHub Copilot and follow the steps outlined above. Don’t forget to actively learn the underlying concepts as you build.

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

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time

10 AI Coding Tools That Will Drastically Reduce Your Debugging Time As a developer, whether you're just starting out or have years of experience, debugging can feel like a neverend

Oct 16, 20265 min read
Ai Coding Tools

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow

10 Common Mistakes When Integrating AI Coding Tools into Your Workflow As developers, we’re always on the lookout for ways to streamline our workflow and boost productivity. Enter

Oct 14, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools That Could Hurt Your Development Process

5 Myths About AI Coding Tools That Could Hurt Your Development Process As a solo founder or indie hacker, you might be lured by the promises of AI coding tools that claim to simpli

Oct 13, 20264 min read
Ai Coding Tools

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026

5 Common Mistakes Developers Make When Using AI Coding Tools in 2026 As AI coding tools have become an integral part of a developer's toolkit in 2026, many are still stumbling over

Oct 12, 20264 min read
Ai Coding Tools

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026

5 Myths About AI Coding Tools: What Every Developer Should Know in 2026 As we dive into 2026, the landscape of AI coding tools has evolved significantly, yet many developers still

Oct 11, 20263 min read
Ai Coding Tools

Why AI Coding Assistants Are Overrated for Beginners in 2026

Why AI Coding Assistants Are Overrated for Beginners in 2026 As a solo founder or indie hacker, it’s tempting to think that AI coding assistants are the silver bullet to jumpstart

Oct 10, 20263 min read