I don't think that there's a single "best way" to learn anything:<p>- Different people have different learning styles, so what works for one person may not work for another. For example, I get much more out of reading books than from watching lectures.<p>- Different people have different amounts of time that they can devote to learning, and have different limits on how long they can keep their attention up.<p>- Different people have different backgrounds. If you're a mathematician who is learning to code, you might want to approach it very differently than a novelist learning to code.<p>- Different people have different financial situations. So advice like "enroll in this bootcamp that costs $6000" might not be possible for you.<p>Also, if you're looking for recommendations for specific resources, you need to specify which programming language you're interested in learning.<p>So unless you tell us more about yourself, your background, your goals and what you've already tried, you probably won't get information that's useful to you.<p>One thing that I think is universal: to learn to code, you must write code. You can't just read books or watch videos, you need to actually do the exercises (which may seem very simplistic and boring at first) and get them to run correctly. Learning to debug is an integral part of learning to code, since even fairly simple programs are hard to get right the first time.