Ai Coding Tools

How to Use GitHub Copilot to Write Your First 50 Lines of Code

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First 50 Lines of Code

If you’re a beginner coder, staring at a blank editor can be daunting. You might wonder, "Where do I even start?" That's where GitHub Copilot comes in. This AI-powered coding assistant can help you generate code snippets, suggest functions, and even complete entire files. In this guide, I'll walk you through using GitHub Copilot to write your first 50 lines of code, so you can get started without feeling overwhelmed.

Prerequisites

Before you dive in, make sure you have the following:

  • GitHub Account: You'll need an account to access Copilot.
  • Visual Studio Code (VS Code): This is where you'll be writing your code. Download it here.
  • GitHub Copilot Subscription: As of 2026, it costs $10/month or $100/year. There’s a free trial for 30 days, which is great for testing it out.

Step-by-Step Guide to Write Your First 50 Lines of Code

Step 1: Install GitHub Copilot

  1. Open VS Code.
  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side.
  3. Search for "GitHub Copilot" and click "Install."
  4. Follow the prompts to log in to your GitHub account and activate your subscription.

Step 2: Start a New Project

  1. Create a new folder for your project.
  2. Open the folder in VS Code.
  3. Create a new file named app.js (or any other language file you prefer).

Step 3: Write Your First Line of Code

Type a simple comment in your file to describe what you want to do. For example:

// Function to add two numbers

Hit Enter, and GitHub Copilot will suggest a function. Accept the suggestion by hitting Tab.

Step 4: Expand Your Code

Continue writing comments or function headers asking Copilot for help. For example:

// Function to subtract two numbers

Again, accept the suggestion. Repeat this for other basic operations—multiplication, division, etc.

Step 5: Test Your Code

  1. Add some console logs to see the output:
console.log(add(5, 3)); // Should output 8
console.log(subtract(5, 3)); // Should output 2
  1. Run your code by opening a terminal in VS Code and typing:
node app.js

Expected Outputs

If everything goes well, you should see the outputs in your terminal. This will give you a sense of accomplishment as you see the results of your first 50 lines of code.

Troubleshooting Common Issues

  • Copilot Not Suggesting Code: Make sure you’re connected to the internet and that your GitHub Copilot subscription is active.
  • Error Messages: If your code doesn’t run, double-check for syntax errors or typos. Copilot can’t always generate perfect code, so you might need to tweak things.

What's Next?

Now that you’ve written your first lines of code, consider exploring more complex projects. Perhaps try building a simple web app or a command-line tool. GitHub Copilot can assist you along the way, but remember, it’s important to understand the code you’re writing.

Conclusion: Start Here

Using GitHub Copilot can significantly reduce the initial hurdles of coding. Start by installing it, writing simple functions, and gradually building your skills. Remember, it’s okay to rely on Copilot for suggestions, but make sure to learn the underlying concepts as you go.

What we actually use: GitHub Copilot is now an essential part of our coding workflow, especially for rapid prototyping and learning new languages. However, it’s not perfect—always double-check the code it generates for accuracy and best practices.

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