Practice
You can read mountains of books and have all the theoretical knowledge in the world, but just like everywhere else, practice is what matters most here. It is a good idea to read a small book that introduces you to the basics and syntax of the language, but after that you should try things on your own, starting with the very first steps. Of course, at the beginning you may need a lot of help from others and you will be crawling on all fours, but in time you will stand on your own two feet, and the more you walk, the easier it will be for you to solve any problem.
Desire
Set yourself a goal and never give it up. It is wise to set interconnected goals, in case you stop living for one of them. Do not be down-to-earth and aim as high as you can. Along with the goal, also set a schedule. It will come in handy in your professional career, because you will get used to dosing your work precisely. For some, this may feel like extra work, but imagine not having it: you would add dozens of extra features to the project, and only at the end would you find out that your rough estimate was exceeded by 200% and that the end result did not improve much.
Talent
You need strong logical thinking and the ability to analyze things in detail. Without that, you will not get anywhere. You should be flexible and learn new things quickly, because new technologies appear here on the fly. You must be able to make rational decisions even in tense situations, because this work is mentally very exhausting and you have to decide how to distribute your energy optimally.
Role Models
Hard work goes better when you have someone who went through it before you. Make connections, whether personal or virtual, and meet up. If you really get deep into programming, you will value warm human company 100x more than ever before. Moreover, your idol does not have to attract you only with their achievements, but also, for example, with their life journey. In the best case, inwardly declare yourself their successor.