John was learning how to code by watching courses and reading tutorials. However, he was not practicing what he learned and was just copying code without understanding how it worked. He became frustrated easily and lost motivation because he thought he would never know everything. To succeed, it is important to set clear learning goals, understand each new concept by typing the code, take notes, practice coding regularly through exercises and personal projects, and ask others for help.