I see that several people have suggested here to make a plan for the game beforehand, be it on paper and/or GDD. This is something where I disagree. You’d need to know quite a lot about game dev to be able to plan that much ahead. Your first game is not likely to be a very original game nor it should be, so having a detailed plan doesn’t necessarily help you much here. On the contrary it may result you overthinking the problems as you don’t know at that stage what is easy and what isn’t. That being said, it’s always good to make notes when you try to figure out things (pen & paper is great for this purpose), I just wouldn’t dig that deep into game design side for the first game projects.
My advice would be - like many have posted here already - to make something simple first and start expanding your skills after that. It’s a lot easier to see how all things come together after you get your first simple pieces working right.
Another thing I’d like to say is to always break your problems into smaller pieces. If you try to solve everything at once, you may feel clueless where to even begin with. So split your complex tasks into smaller manageable tasks (also at code level) and you’ll see that not even biggest problems are that difficult when you can solve them piece by piece.