You need to practice as much as possible.
View the source code of open source projects - is also a good way to learn different approaches.
There is also a huge number of lessons and training screencasts on youtube.
By the way, I just found an interesting project http://exercism.io/
It is also a good way of learning. Experienced developers will point out your mistakes and advise what approach is more preferable in a given situation.