Another thing: walk away, come back, bug fixed.
And the other one: explain code to a friend or yourself
Learn basics like command line, version control, how to use a editor productively.
Built good habits early, learn from experienced developers.
Read some Kent Beck or Robert Martin books.
The number of people who think they need to absorb everything before they write a single line of code is quite high. Forget all that. Write the simplest program you can, even a hello world, and get it to compile and run. Now add or change something, compile and run. Did it work as you thought it would? Then continue. If something went wrong, then Google is your friend. Search for answers, ask other programmers, make notes on the language as you go. Only after you've made a few mistakes, read a book, because you'll have some prior knowledge to give it context and make it stick.
That's what works for me anyway.
If you understand database design then object oriented programming is a cake walk.