Welcome to SI and I'm sorry that you're here and feeling so lost. There are some posts pinned to the top of the JFO (Just Found Out) forum that you may find helpful, even after 2.5 years. The Healing Library is full of resources, too.
If you can, IC (individual counseling) with a betrayal trauma specialist may be helpful. It sounds like you have some symptoms of PTSD. There's also PISD (post-infidelity stress disorder) that you should be able to find some articles on. There's no established diagnosis for it, but there are studies that people who have suffered through infidelity have these symptoms.
Maybe see your doctor for some medication to help you sleep? I had to go on something to help me sleep in the beginning.
Also, I got one of those meditation apps and learned to meditate. It was so helpful with helping my thoughts when they were spiraling out of control. It took a while to get there, but it has been so helpful.
Also, if you're constantly thinking of certain things, you're creating a neural pathway in your brain for your thoughts to automatically go there. Doing certain things like playing certain match 3 games have been shown to help rewire your brain so that you're not automatically going to those triggers.
We have a lot of collective wisdom, and you'll see all kinds of advice. Take what works for you and leave the rest.
BW M 34years, Dday 1: March 2018, Dday 2: August 2019, D final 2/25/21