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.
Then give which time of the day/week you can work on that.
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.
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.
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.
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 :)