The best way to do that is intentional practice with feedback!
Code katas are exercises you can try many times over, and they’re a great way to learn.
Industrial Logic’s Code Katas album is free, and it will let you practice TDD, refactoring, and other programming skills in Java. We plan to add a new kata every month, a classic or a new one.
Start this month with the famous Gilded Rose refactoring exercise.
"Industrial Logic’s web-based skill-building courses are simply the most effective self-paced eLearning on Agile technical practices available today. It’s the next best thing to having an instructor by your side! It helped HP scale Agile globally in a very cost-effective, flexible way."Dennis Hong, Former Learning Program Manager, HP