Once you’ve developed a spidey sense that something is amiss, when a distraction arises, you can then change how you behave. You can put down the distraction, say an email, and get back to what matters.
In doing this enough times you will develop a habit of quickly getting back to what matters. Distractions will cease to distract you. This is great because avoiding a distraction isn’t always possible.
For example, if you stumble upon an article about 5G phone networks when you’re supposed to be paying the bills, perhaps print the article so you can read it later. It’ll sit in the printer tray as a reminder so you can let go of needing to read the article right now. Even if you’re half way through the article, stop reading it.