Learn by doing
Programming is not like other theory subject where you can do well by just memorizing it. For programming, it requires lot of practical work to master it. It is recommended to have attitude of trial and error in the learning process where learn from the mistake while conducting the programming work.
Focus on understanding for long term benefit
As I mentioned above, programming cannot be mastered by just memorizing it, you must understand it. According to the research, student who rush at the beginning of their course is more likely will stuck when continue for more advance material. This is because student that rush at the beginning does not focus much on understanding and not build up a strong base when facing more advanced material.
Code by hand
Although now there are many modern technologies like computer and Internet which can help you learn programming in a second of time, but learn programming by writing it out still the most effective way. Code by hand is different that coding using computer where it is easier to notice the mistake on computer. However, it requires more cautious and precision when code by hand. Other than that, many company interview programming candidates and require them to code by hand because they know this method is the best way to test the efficiency of programmer.
Take break while debugging.
It usually not an easy task to debug a program and there is no guarantee that the problem will be solved if you face the problem for few hours. Therefore, take a break when cannot solve the problem and come back with new perspective. Always remember that there will be no ending for problem and always have a break to make your brain fresh and face the problem with better productivity.