If this happens too many times in a row, I assume I'm tired, so I switch to a more manual task (like doing the dishes).
I remember times when I just had to study at that moment. I would force myself to re-read sentences until they made sense. I would rephrase the sentence or read the same sentence in another language that I know, until it made sense. I could spend the whole afternoon focussing on just a few pages. But I think it was a good exercise. I think focus is like a "muscle" that can be trained a bit.