Ai Coding Tools

How to Use GitHub Copilot to Write Your First Function in 15 Minutes

By BTW Team3 min read

How to Use GitHub Copilot to Write Your First Function in 15 Minutes

If you’ve ever stared at a blank screen, wondering how to start coding a function, you’re not alone. Many of us have been there, overwhelmed by the possibilities and unsure where to begin. Enter GitHub Copilot, an AI-powered coding assistant that can help you write your first function in just 15 minutes. While it sounds almost too good to be true, I’m here to walk you through exactly how to do it, with some honest insights along the way.

Prerequisites: What You Need to Get Started

Before diving in, make sure you have the following:

  • GitHub Account: You’ll need an account to access Copilot.
  • Visual Studio Code: This is the IDE where we'll be using Copilot.
  • GitHub Copilot Subscription: As of March 2026, pricing is $10/month for individuals or $19/month for teams, with a 30-day free trial available.

Step 1: Install GitHub Copilot in Visual Studio Code

  1. Open Visual Studio Code.
  2. Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window.
  3. Search for "GitHub Copilot" and click on the install button.
  4. Once installed, you'll need to sign in with your GitHub account to activate it.

Expected Output: You should see the Copilot icon in the bottom right corner of your VS Code.

Step 2: Start Writing Your Function

  1. Create a new JavaScript file (e.g., myFunction.js).
  2. Type a comment describing the function you want to create, such as // A function that adds two numbers.
  3. Hit Enter, and Copilot will suggest a complete function based on your comment.

Expected Output: Copilot should generate a function like this:

function addNumbers(a, b) {
    return a + b;
}

Step 3: Test Your Function

  1. Below the function, write a small test to see if it works:
console.log(addNumbers(2, 3)); // Expected output: 5
  1. Run the code by using the terminal in VS Code.

Expected Output: You should see 5 printed in the console.

Troubleshooting: Common Issues

  • Copilot Not Suggesting Code: Make sure you’re typing in a supported language and that Copilot is enabled.
  • Suggestions Not Relevant: Try rephrasing your comment or providing more context. The clearer you are, the better suggestions you’ll get.

What’s Next: Expanding Your Skills

Once you’ve successfully written your first function, consider the following next steps:

  • Explore More Functions: Try writing functions that manipulate data structures or handle API requests.
  • Integrate with Other Tools: Look into how Copilot works with testing frameworks like Jest or Mocha to ensure your functions are robust.

Conclusion: Start Here

Using GitHub Copilot to write your first function can be both empowering and educational. It significantly reduces the friction of starting from scratch and provides helpful suggestions as you code. Just remember, while it’s a fantastic tool, it’s not perfect—always review and test the generated code.

If you’re ready to dive into AI-powered coding, give GitHub Copilot a try. With its subscription starting at $10/month, it’s a small cost for a potentially big boost in productivity.

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 Mistakes New Developers Make When Using AI Tools

10 Mistakes New Developers Make When Using AI Tools As we dive into 2026, AI tools have transformed the coding landscape. But with all the excitement, new developers often stumble

Mar 16, 20264 min read
Ai Coding Tools

How to Use Cursor.ai for Rapid Prototyping in Under 60 Minutes

How to Use Cursor.ai for Rapid Prototyping in Under 60 Minutes In the fastpaced world of building side projects, getting an idea from concept to prototype can feel overwhelming. Ma

Mar 16, 20263 min read
Ai Coding Tools

Why GitHub Copilot is Overrated: Contrarian Perspectives on AI Coding Assistants

Why GitHub Copilot is Overrated: Contrarian Perspectives on AI Coding Assistants As a solo founder or indie hacker, you’re always on the lookout for tools that genuinely boost your

Mar 16, 20264 min read
Ai Coding Tools

How to Build Your First App Using AI Tools in Under 3 Hours

How to Build Your First App Using AI Tools in Under 3 Hours If you're a solo founder or an indie hacker, the thought of building an app might seem daunting. But what if I told you

Mar 16, 20265 min read
Ai Coding Tools

Top 5 AI Tools for Beginners in 2026: Your Launchpad

Top 5 AI Tools for Beginners in 2026: Your Launchpad As a beginner diving into the world of coding in 2026, the landscape is flooded with AI tools promising to make your journey sm

Mar 16, 20264 min read
Ai Coding Tools

Supabase vs Firebase for AI-Driven Projects: A 2026 Comparison

Supabase vs Firebase for AIDriven Projects: A 2026 Comparison As we dive into 2026, the landscape for building AIdriven applications has evolved significantly. If you're an indie h

Mar 16, 20264 min read