Depends on what kind of learner you are. If you learn by reading (like me) you could get good at it simply by reading tutorials, getting the correct result, and then tweaking it and getting your desired result. If you learn by listening (also like me), It would be good to get a friend or someone who is experienced to help you learn. If you learn by doing, Trial and error is not bad, as long as you save copies of your work often!
The main obstacle in coding is time. You need to be dedicated and have at least a little bit of time to spend on coding, at least a couple times a week if you want to become a serious game maker. I stopped working on it for a month and that's all it took for me to forget a lot of what I learned.