Ai Coding Tools

How to Use GitHub Copilot to Write Your First Code in 2 Hours

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Code in 2 Hours

If you're a beginner looking to dip your toes into coding, you might feel overwhelmed by the sheer volume of resources and tools available. The good news is that GitHub Copilot can make the process a lot easier and faster. In just two hours, you can harness the power of AI to start writing your first lines of code. In this guide, I'll walk you through how to get set up and actually write something useful, all while being straightforward about the limitations and trade-offs.

Prerequisites: What You Need Before Getting Started

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

  1. GitHub Account: You’ll need an account to access Copilot.
  2. Visual Studio Code (VS Code): This is the IDE where you'll use Copilot. Download it here.
  3. GitHub Copilot Subscription: As of August 2026, Copilot costs $10/month after a free trial.
  4. Basic Understanding of Coding Concepts: Familiarity with variables, functions, and control flow will help, but you don't need to be an expert.

Step 1: Setting Up GitHub Copilot

  1. Install Visual Studio Code: Download and install VS Code if you haven't already.
  2. Install the GitHub Copilot Extension: Open VS Code, go to the Extensions view (Ctrl + Shift + X), and search for "GitHub Copilot". Click "Install."
  3. Sign In to GitHub: After installation, you’ll be prompted to sign in to your GitHub account. Follow the prompts to authorize the extension.

Expected Output: You should see a Copilot icon in your VS Code sidebar once it's installed.

Step 2: Writing Your First Code

Let’s write a simple "Hello, World!" program in Python.

  1. Open a New File: Create a new file and save it as hello.py.
  2. Start Typing: Type print("Hello, and wait for Copilot to suggest the rest.
  3. Accept the Suggestion: If Copilot suggests World!"), press Tab to accept.

Expected Output: When you run the code using python hello.py, you should see Hello, World! printed in your terminal.

Step 3: Experimenting with More Complex Code

Now that you’ve written your first line of code, let’s try something slightly more complex—a function that adds two numbers.

  1. Define a Function: Start typing def add_numbers(a, b): and wait for Copilot’s suggestion.
  2. Accept the Suggestion: If it proposes a body for the function, press Tab.
  3. Call Your Function: Below the function definition, type print(add_numbers(3, 5)) and run your code.

Expected Output: You should see 8 printed in your terminal.

Troubleshooting: What Could Go Wrong

  1. Copilot Doesn’t Suggest Code: If Copilot isn’t providing suggestions, check if you’re connected to the internet and logged into GitHub.
  2. Errors in Code: If your code throws an error, double-check the syntax. Copilot can make mistakes, especially with complex logic.

What’s Next? Building on Your Knowledge

Once you've mastered the basics with GitHub Copilot, consider:

  1. Building a Simple Project: Try creating a basic calculator or a to-do list app.
  2. Learning Further: Explore more complex programming concepts such as classes and APIs.
  3. Join Communities: Engage with other learners on platforms like GitHub Discussions or Reddit to share your projects and get feedback.

Conclusion: Start Here

GitHub Copilot can significantly reduce the learning curve for coding, allowing you to write your first code in under two hours. It’s not a magic solution; you'll still need to learn and understand the fundamentals. However, it can be a powerful ally in your coding journey.

If you're serious about getting started with coding, I recommend diving into GitHub Copilot right away. The combination of AI assistance and hands-on practice can set you on the path to becoming a competent developer.

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