When I'm busy with a project, the things I don't understand very well make me curious and cause me to think of things to learn/make. I recently began to combat this by keeping a list of things that would be cool to learn and/or build and referring it when I'm bored. So far its been working pretty well