I used to have the same thing - in the quiet of night, my brain went nuts, and sometimes I would even have a full-blown anxiety attack. Now that I've been sober a while, it doesn't happen very often. I find that guided meditation helps. There are lots on YouTube, and there are also phone apps. When your mind starts racing, put your headphones in and play a guided meditation tape.
The advice to consult a therapist is good, too. You might benefit from behavioral therapy, or even anti-anxiety meds. When my anxiety disorder was at its worst, I went on meds and they helped a ton. I don't need them anymore, because once I'd been sober a while the anxiety got better, and I also learned to let those thoughts go. It does take practice.