If it's any consolation, this type of question, along with the "I start projects and get distracted by more interesting ones before I can finish them", seems like a very common problem around here. I don't have a definitive answer but what works for me is I work on an interesting project in parallel to learning about a topic. For example, if I am learning about compilers, I will think of a programming language and write a compiler for it. I usually try to pick an original project that is at least minimally useful because otherwise I lose interest quickly. If I can't come up with anything, I might just write some blog post(s) about the subject.