Our brains often function like a river, sometimes running dry and other times overflowing with ideas. Stack Exchange explains the best way to stay focused and on-track when ideas start to overflow:
(Note: The term “iteration” is used here in reference to a phase of a programming project, but the answer still works for any type project, computer-based or otherwise.)
[Try] agile methodologies
At the beginning of an iteration you’ll plan what you’ll be doing for the next 2 or 3 weeks…and then you shouldn’t change any of your tasks, which includes not implementing anything new that wasn’t planned beforehand.
Once an idea comes to you, write it down somewhere and try to forget about it. The idea might seem brilliant at the moment (or at least better than your current task), but it might not seem so good some time later. Give your ideas time to settle, then come back to them and try to assess them again with a fresh look (probably at the beginning of an iteration when you need to plan the next few weeks).
And one more thing that I think could be helpful. Always assume that your new idea is a bad one. Don’t rush to implement it, take your time.
Sticking to a weekly plan of action and writing down ideas as they come to you ensures that you get work done without missing the opportunity new ideas can present down-the-line.
There are a lot more helpful solutions to consider if you’re fortunate enough to suffer from having too many ideas (commonly referred to as “feature creep” for projects). And if you’re struggling to come up with ideas, make sure to bookmark the question and answers.