I had this same problem. I have wanted to make games since I was a kid and we put RM2k on the school computer and have attempted to get into making my own game for the better part of a decade. Every unsuccessful attempt I've had I tried to work my way through tutorials and pick up things that way, I was able to work through them but then retaining the information and using it later on projects I had going while watching the tutorials was a problem, I just wasn't fully comprehending the intricacies of programming and would make mistakes that in hindsight should have been obvious but would go over my head, things like bracket and semicolon placement or missing a single parenthese, but I would overthink it and second guess the logic I learned and pretty much unlearn things if that makes any sense.
The past few months I have switched it up and just been finding fully completed sample projects in GMS and Unity they finding the bits and pieces I want to learn and taking them apart and really getting to know them. Once I know how they work I use what I learned in a game I'm making that I'm slowly incorporating everything in and I am about 70% done with my first game and have gotten to the point where the coding is more or less done and just needs to be cleaned up and put into a more readable and efficient format but it works and I feel like I understand coding logic a lot better now and could make a simple game on my own without references or pasta. I think the big difference here is learning the nuts and bolts of it before learning good form and coding practice, which is important but useless if you don't have the base skill to apply it to. Lots of tutorials on youtube are made by really knowledgeable people but they either jump right into best coding practices or they show you an example of a simplified one then say "but that's not how we're going to do it" then go back and have you erase what you just learned only to do it again a different way and that always threw me off and took the wind out of my sails while also making it hard to pick up a 20 part 45 minute each tutorial series. Looking at multiple versions of finished things like platformer and ARPG codes for commonly used engines and seeing common practices and how they work and having the ability to see what happens when I change bits and pieces is something that can be picked up and left off at any time and it feels like there is a lot more potential to learn because it's not a blank slate dependent on what someone is instructing me to write at the pace of molasses.
If your goal is to learn coding this is what has helped me understand it. If your goal is to make good games there is more than enough modular assets available on any of the major engine's storefronts, think of it as small scale outsourcing or better yet think of hiring a coder like hiring a landscaper, the guy with the botany degree and a team of people that does custom work will cost more than the kid with the mower that goes over every lawn the same way. Asset store code is that quick mow, you can still make the yard look good and that is an integral part of it but you will have to put in some work to make the yard your own. Of course give credit if you use anything but the end goal here is to make something fun that resonates with people, whether or not you coded every detail from scratch will not make it any more fun. Yes, a basic understanding of coding will allow you to implement what you and grant you the freedom of not just having to work with set templates and no you shouldn't just asset flip and call yourself a dev but there is no shame in saving time.
Anyway, maybe try out reverse engineering a template or completed tutorial and working at your own pace, keep up at it and good luck to you.