I once wondered if IDEs create .gitignore for you, but most don’t.
You can manually create one by adding a file called .gitignore in your project folder.
Use a template or add rules yourself depending on what you want ignored.
After creating it, don’t forget to stage and commit it with:
git add .gitignore
git commit -m "Add .gitignore file"
That way, Git will stop tracking the files or folders you list there from now on.