Overall, taking good advantage of the breaks, like stretching, looking at the horizon, appreciating the nature outdoors, etc help, but looking into reducing distractions can also be great, preparing healthy snacks beforehand, etc.
On the other hand, taking a look into possible attention disorders may come in handy, I tackle my ADHD with a blend of functional mushrooms these days, they help me get productively through the workday and the grind afterwards.