I often find myself doing the same thing sometimes. What helps me is keeping myself occupied and have my mind focused on either my job or reading a book. Then again if it's a good book then I can't stop thinking about what's gonna happen next so yeah the cycle pretty much starts again