Inability to focus is a common problem. For writers, it’s almost a work hazard. Our job is to let our minds wander, to follow a train of thought in the hope that it will lead to innovation.
There’s a very fine line between opening the psyche to allow The Muse to enter, and being blindly led by the latest shiny object.
The way to perfect the former and avoid the latter is through deliberate practice. One strategy that has worked wonders for me is daily meditation using the programs developed by Andy Puddicombe and the team at headspace.com.
Do your work, then check it out.