Leo in his article named constant task switching Talks about how to stop wandering and gives some simple steps one can follow to get the Focus back.
I know I’m losing focus when I’m constantly jumping around from task to task.
This is a “red flag” for me — a sign that I’m doing something wrong. You’ve done it too: switching from one browser tab to another, opening various emails and other messages, checking on this and that. No focus, lots of stress, lots of mental exhaustion without really getting anything done.
The solutions he offers later in the article are minimal, clear and easy to put to practice.