When I was learning C, I would write my program, then run it step-by-step in the debugger (I was using Visual Studio at the time) until it was pointless to do so because I knew what would happen next. If I made a change and did not have a mental model of what would happen, I would run the debugger.
Learning how to solve problems is a different process, but this gave me good understanding of basic code structures.
Learning how to solve problems is a different process, but this gave me good understanding of basic code structures.