late night thoughts keeping me up

I stay up at night thinking about my ex and it's the worst feeling because he's probably sound asleep. I lay there for hours just replaying memories in my head and I try as hard as I can to block them out but it doesn't work and I end up falling asleep at 2 or 3 in the morning, this is coming from someone who usually goes to bed at 10 or 11. It's killing me I don't know what to do (going back to him or communicating is not an option I respect myself enough) I just want to be happy again :(