I often find it hard to concentrate on uninteresting details (programming bugs etc.) where I already know the outcome, but it takes time and concentration to fiddle. Sometimes I procrastinate and start the internet for interesting (but work-related) stuff. I feel restless and don't go into much depth, but rather collect ideas for later but not related to the main task.
However, I notice clearly that after waking up or late in the afternoon again I feel much more calm. Do you know an explanation? Maybe noise during the day irritates me, maybe circadian rythm or something related to dopamin, or just too much internet flood? That's just some wild guesses. What's your experience if you have similar? Sleep, sometimes sport or a bath (noise of water) can relax the mind wandering.
Can you suggest methods to concentrate better and avoid the shallow breadth search for new ideas? Maybe meditation, or headphones with music or other sounds, or some beverage, or having regular breaks.