I began to code when I got into university. I knew little about computers. I was a bit lost on the first computer science classes. A student's mentor took the time to listen to my frustrations about programming and was kind enough to help me on a Friday evening, just so that I could understand the basics of Python language (the first language I learned). That day I finally got into coding and started to like it.
I currently working as an Android Developer and on my Masters' degree thesis focused on security.
After so much time getting used to coding with Java, I got to learn Kotlin by doing a sample project. First I tried the training using the exercises from the official website, but I found it more helpful to learn it while coding a project from scratch.
Surround yourself with people that inspire you and believe in you.
Don't get discouraged if you don't find a mentor in person. There are so many inspirational people from the industry, on the Internet, that can still inspire and motivate you, even if you don't know them in person.
If you're already in this industry, help and support people that are new to it and might be switching careers.
For beginners: coding is a skill like any other that takes time. Don't be discouraged if others seem to learn it faster than you. Everyone has its own pace of learning.