Learning to code is like trying to lose weight. This analogy applies to learning anything really, but learning to code is a special match here.
“Losing Weight” is a negative term. We should really call it “Gaining Health.” In that sense, it is very much comparable to “Gaining Knowledge.” The educational resources you have available to you are like your food options. Some are just okay, some are great, and some are completely bad for you. Eating healthy and exercising are the main two activities that will help you gain health. Similarly, consuming good educational resources and practicing coding by hand are the main two activities that will help you gain good coding knowledge.
So how do you learn “healthy”? When you commit to eating healthy, you use filters like organic, local, reduced-fat, and grass-fed. It is exactly the same with healthy educational resources except these labels are not yet as clear. I hope educational resources will someday have verifiable and relevant labels too. Maybe labels like “not-sponsored,” “no-marketing,” “approved-by-experts,” “tightly-edited,” and “dragons-ahead.”
Yet, instead of filtering by the content, you can easily filter by the good brands. I do that with food too. I know and trust a few brands and I mostly use those. It is easier. With educational resources, there are some brands (publications and people) that you should just follow all the time.
After filtering your knowledge intake to only the good resources, you just need to exercise! Practice everything you learn, but not just by re-doing exactly what you learned. Also challenge yourself to do something slightly different around the topics that you learned. If you are lucky, you will get stuck! Then you will permanently learn something else when you get unstuck.
Exercise is for both the body and the mind.