The first part of learning how to code is having perseverance.
Obviously, all skills require perseverence to learn and master, but understand that even when you get good at programming, a stray semicolon or the wrong operator somewhere can still catch you out, potentially for days. Moreso, in fact, since when you're just starting out your programs will be small and simple. Try finding the single errant semicolon causing your code to crash when you have hundreds of lines of code across twenty to thirty files to sort through.
Usually IDEs offer error messages that tell you exactly where they broke. Where they broke is not necessarily where the mistake is but at least provides a starting point.