1 - Define Your Goals
The first thing you need to do is defining what you want to do to keep you motivated. It can be working full time in a developer job or learning a new language.
2 - Create a Schedule
Then give which time of the day/week you can work on that.
3 - Start Simple
Instead of focusing on your big goal, divide your goal into sub-goals. This will help you to achieve them much more easily and with that way you can track your progress.
4 - Remove any Distractions
During researching or creating projects, try to disable all notifications while working. Just put yourself into work mode in that time. Believe me, this can increase your productivity tremendously.
5 - Progress Your Work
At the end of the day, note what you have done. This will make you be proud of yourself and help you to realize how easily you can improve yourself. Maybe in the first week, you do not care much, but after that, you will see what you have done.
6 - Share What You Have Learned
Try to share what you have learned with others, this will make you more confident about what you have done and it will help you grow your audience in the tech community.
This can also be useful in interviews.
You can also share pizza of course :)