Ai Coding Tools

How to Use GitHub Copilot to Write Your First Code in Under 1 Hour

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Code in Under 1 Hour

If you’ve ever stared at a blank code editor and thought, “Where do I even begin?” you’re not alone. Many new coders feel overwhelmed by the sheer amount of knowledge required to write even a simple program. Enter GitHub Copilot, an AI-powered coding assistant that can help you write code faster and more efficiently. In this guide, we’ll walk you through using GitHub Copilot to write your first piece of code in under an hour.

Time Estimate: 1 Hour

You can finish this tutorial in about 60 minutes if you follow the steps closely.

Prerequisites

Before we start, make sure you have the following:

  1. A GitHub account (Free)
  2. Visual Studio Code installed (Free)
  3. GitHub Copilot subscription (Free trial available, $10/mo after trial)

Step 1: Set Up GitHub Copilot

  1. Install Visual Studio Code: If you haven't done this yet, download it from here.

  2. Sign in to GitHub: Open Visual Studio Code and sign in to your GitHub account.

  3. Install 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."
  4. Start Your Free Trial: When prompted, start your free trial to use Copilot.

Step 2: Create a New Project

  1. Open a New Folder: Create a new folder on your computer for this project and open it in Visual Studio Code.

  2. Create a New File: Create a new file named hello_world.py (if you're coding in Python) or hello_world.js (for JavaScript).

Step 3: Write Your First Code

  1. Start Typing a Comment: Begin by typing a comment that describes what you want to do. For example, in hello_world.py, type:

    # This program prints "Hello, World!" to the console
    
  2. Let Copilot Suggest Code: After typing the comment, hit Enter. Copilot will suggest code. You’ll see a suggestion pop up. Just hit Tab to accept it.

  3. Run Your Code:

    • For Python: Open the terminal in Visual Studio Code and run:
      python hello_world.py
      
    • For JavaScript: Run:
      node hello_world.js
      
  4. Expected Output: You should see "Hello, World!" printed in the console.

Troubleshooting

  • No Suggestions?: If Copilot isn’t suggesting anything, try typing a more detailed comment or starting a function.
  • Incorrect Code: If the code doesn't work, check for syntax errors or typos. Copilot is great but not infallible.

What's Next?

Now that you've successfully written your first piece of code, you might want to explore more features of GitHub Copilot:

  • Try More Complex Functions: Experiment with more complex algorithms or projects.
  • Explore Different Languages: Copilot supports multiple programming languages. Try coding in Java, C#, or Go.
  • Integrate with GitHub: Learn how to push your code to a GitHub repository and collaborate with others.

Conclusion

Using GitHub Copilot can significantly reduce the time it takes to write code, especially for beginners. Start with simple projects, and as you grow more comfortable, you can tackle more complex coding challenges.

What We Actually Use

In our experience, we use GitHub Copilot primarily for rapid prototyping and quick code suggestions. It’s great for simple tasks, but we double-check the code for more complex projects.

Start here: If you’re just starting, follow the steps outlined above. Don’t hesitate to experiment and learn as you go!

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