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

How to Solve Common AI Coding Problems in 30 Minutes

How to Solve Common AI Coding Problems in 30 Minutes As a solo founder or indie hacker, running into AI coding problems can feel like a punch to the gut. You’ve got a million thing

May 10, 20264 min read
Ai Coding Tools

Vercel vs GitHub Copilot: The Ultimate AI Tool Showdown

Vercel vs GitHub Copilot: The Ultimate AI Tool Showdown (2026) As indie hackers, we often find ourselves juggling multiple tools to streamline our workflows and enhance our product

May 10, 20264 min read
Ai Coding Tools

How to Integrate Cursor, GitHub Copilot, and Codeium in Your Workflow in 30 Minutes

How to Integrate Cursor, GitHub Copilot, and Codeium in Your Workflow in 30 Minutes As indie hackers and solo founders, we often juggle multiple tasks, and our coding workflow is n

May 10, 20264 min read
Ai Coding Tools

Should You Choose ShiftLeft or Codeium? A 2026 Comparison of Code Quality Tools

Should You Choose ShiftLeft or Codeium? A 2026 Comparison of Code Quality Tools As developers, we’re always on the lookout for tools that can improve our code quality without addin

May 10, 20263 min read
Ai Coding Tools

Top 5 Overrated AI Coding Tools in 2026: Why They Didn't Deliver

Top 5 Overrated AI Coding Tools in 2026: Why They Didn't Deliver In 2026, the hype around AI coding tools reached a fever pitch, promising to revolutionize how developers write cod

May 10, 20263 min read
Ai Coding Tools

How to Solve Common Coding Errors Using AI in 30 Minutes

How to Solve Common Coding Errors Using AI in 30 Minutes As a solo founder or indie hacker, you know the frustration of staring at a coding error that just won’t budge. You’ve spen

May 10, 20263 min read