The thoughts are hell. It's been a while, but I clearly remember. Do whatever (healthy thing) it takes to bump your brain off them. Sometimes I literally focus on the here and now: You're walking down the hall, when you get to the end of the hall you'll go into the room, when you're in the room ... it seems to occupy the brain enough to silence the thoughts, maybe because when you're using your brain this way it's busy thinking of the next step you need to take.
In bed I play a sound machine and run a fan. To occupy my brain I plan an event. I've planned elaborate tea parties, birthday parties, dinner parties, Christmases, etc. I've imagined what I'd buy if I had endless money. Something neutral and pleasant. If you become aware of the racing thoughts returning, gently guide yourself back. Sometimes I go to sleep in the middle of it, so I guess it works.
There are books, workbooks and cd's with better techniques at libraries, bookstores and probably online.