According to successful people, it takes around 20 hours to learn a new skill and 10000 hours of continuous efforts to be an excellence in a skill. The same goes for coding.
Programming is a skill that helps humans to make working mechanisms out of dumb machines making human lives more efficient and more powerful.
Earlier, to learn a skill people used to join classes, go to colleges, or work as an apprentice. This required a lot of effort, time, and money. In the age of the internet, information has lost its value. To master a skill all you need is a device to access the internet, time, and a lot of dedication.
Just by taking a Udemy course worth $10 or $20, you can become a software developer, musician, artist, improve your personality, learn share market which in turn helps you make thousands and millions. If $20 sounds too much just start surfing google with the right keywords and you will land to a site that will give some knowledge, keep on building skills by searching and you can become good at what you are working.
As I said in the beginning, it just takes 20 hours to learn a new skill and 10000 hours to master it. In 20 hours, you can build the basic foundation that is needed for the skill, then you have to make your hands dirty. Practice small exercises, make full projects. In the beginning, it may seem very difficult, just stick on to it, have patience, and practice every day. You can also get associated with communities, like Dev Community is a platform that connects all the developers, these communities help individuals to grow. Also, when you see excellence expressed over the communities, it inspires you to be better skilled and a better human being.