Little did I know this is baked into VS Code!
Press CTRL + Shift + P (CMD + Shift + P on macOS) to open the command palette.
Add gitignore in the command palette.
You'll be presented with a language to generate the gitignore file for.
And there you go! You have a fresh gitgnore file in your repository now!
Happy VS Coding!