When that happens to me, I have to distract myself. And depending on my mood and the situation, different things work in distracting me, and it takes awhile to find something that really works. But usually things that involve my hands work best.

I hope this helps