I always make sure I get some exercise during breaks, drink enough and get enough sleep.
That way, I always have the feeling that I'm paying attention. If I just sat in front of the PC for hours like a zombie, it would probably look different.
The key is balance here in my opinion.
When I'm stressed or have too many other things going through my head, I tend to make mistakes because I'm not fully focused.
Breathing exercises could probably also help to reset the focus.