When working to achieve a goal, distractions will inevitably arise. Keep a pad of paper and a pen nearby, scribble down distractions to get them out of your mind. Then, refocus on the outcome you set out to achieve and then get back to work.
This allows you to capture the tangential tapestry of ideas that naturally arise without losing sight of the prize.