It is easy to get distracted at any developmental stage. I'm not thinking about many of the usual, and important, distractions: children, lovers, beer. I'm thinking about professional distractions.
What are some (but obviously not all) professional distractions? Almost anything that makes one feel insecure. A colleague, especially one that is junior, receiving an award. A colleague publishing more than you. Someone else's bad science in a field close to yours. Someone else getting a glamour pub for bad work. Learning that someone junior to you has twice the publications, three times the grant money and is ranked triathlete. Oh, and a patent that generates a lot of money.
Now, it's important to be able to distinguish between something that is professionally important versus something that is just a distraction. Sometimes when it feels like you've been scooped, you have to pay attention to the results because they impinge on your work. I'm not talking about those.
So a distraction rears its head. Take a deep breath. Another. And another. Remember that these distractions happen to everyone from grad student to greyhair. It's okay to go to that folder of good things that have happended to you.
One of the most important things is to stop and look at what's going on. Dispassionately. Dispassion is hard for me, as I've often been guided by Heinlein's bon mots: Excess in everything, moderation is for monks. But there are times for dispassion. There are times to not just step back, but to turn off those feelings. Look at what's going on. Ask yourself "what does this really mean?" Really. Mean. Understand that this is just something getting in the way of what you really want to do.
Not perceving what is going on can be most of the problem. And understanding what you are feeling (and it is a feeling, much of the time) gives you the space to get back to a better place in your head. Because its distraction, remember?