When you are learning to code in your free time, it is easy to lose focus and get distracted by all the things going on in your life. Make it a daily habit, even if it is just 15 minutes a day!
Figure out how you learn best, and use the techniques to maximize the time spend learning. You might learn better in the morning, taking notes on paper while listening to background music. Or you learn best in the afternoon with a cup of coffee in the library.
Start by learning how you learn and get more out of the time you spend doing the course!