A willingness to make mistakes and go through a process of trial and error is actually a really good approach to this. You're at the start of what will be a long and difficult journey if you stick with it, and it's unavoidable that you will make a lot of mistakes along the way, but it's also very rewarding. I'm reminded of a relevant blog entry one of our moderators posted a couple of years ago: "become a good programmer in six really hard steps" -- note however that I don't recommend rushing towards steps five and six, they're things that can wait until you're more experienced than you are now.
It sounds like you're on the right track, keep at it!