This is a really tricky question, it can have multiple answers and every person with have his/her way of learning. Here is how i learnt coding and below is my journey:
1. STICK WITH IT - My first serious dive into coding was into java. And my first code that I wrote was on job. I FAILED miserably to even write a small program. It had lot and lot of errors. BUT one thing i did was not to GIVE UP. I had made sure googled the errors and rectified each and SUCCESSFULLY executed the code. it was tiring but was every SATISFYING which made me curious to know more.
Programming is not only about learning syntax but to stick with the problem and find solution as logic always remains the same.
2. STICKING TO SINGLE LANGUAGE BUILD STRONG FOUNDATION - In today's world, every other day a new language comes and we hear that the new language is better than the previous one. Trying multiple language, without exploring the one completely can lead to confusion. Stick to one language learn all its concepts. Logic and Concepts are mostly same in all language only syntax change. So build a STRONG FOUNDATION with one language and then try other. Dont go with crowd mentality.
3. TRY ONLINE CODING AT BEGINNING - Before beginning to code on local machines, i would suggest to learn basic fundamental and start coding on online platform like codeacademy.org so that you are frustrated with setting up the system even before writing a single line.
4. ONLINE TUTORIAL ON YOUTUBE - There are lot places to learn coding like coursera, udemy, etc but at beginning I would suggest learning it from youtube as you can get lot of contents and all are FREE. Try searching things like python for beginner or java for beginner. java course by telusko is really good for beginners.
5. BUILD A PERSONAL PROJECT: This is really important. Build something you like I would say if you like photography create something like board where you can put photos, edit it, change it. Or if you like playing video games create a small game like sudoku. Build something which will keep you motivated. Dont give up in between complete it. One more thing to consider here is to build something which is neither very complicated nor very simple. Build something which useful.
6. ENJOY GETTING HELP - While building project its normal to get stuck, not give up but try to solve it. Use google, stackoverflow, reddit, facebook group like freecodecamp, help and advice from people you know who can help, meetup etc
7. TRY TO ATTEND EVENTS: Participate in events like hackathon on hackerrank, hackerearth etc. This help you do networking and learn. Try to do free volunteering and code for them.
If you have managed to sail through all of the above then you are ready to be part of IT industry. To be among the best next step would be to make yourself better by learning advance topics like Data structures and algorithm, networking, scripting, etc. But i would recommend first make your foundations strong then its going to be a fun ride. Hope it helps you. :)