Are you in control of your brain, or is your brain in control of you?
What's the difference?
It seems like remembering something like this is what your brain does, and so somehow it seems like it should mean that you're choosing to remember this stuff.
Of course that can't be the case, right? We all reject that and believe that we're being tortured by our memories.
There are some people with problems like that who need talk therapy or medication. The brain is complicated. It's not wrong or shameful to seek professional help.
That being said, for the most common situations where this is a minor incident keeping you awake, counterintuitively, it is that circumstance I mentioned before where your brain is actively choosing to remember stuff, against your conscious will.
If you want to change this, you need to practice letting go of intrusive thoughts. Whenever you realize that the thought popped into your head just let it go. Don't think about it further. Don't judge yourself or get emotional. Just let it go. And that practice is exactly what mindfulness meditation is.
Once you master this technique, these ancient intrusive thoughts will bother you less and less and when you wake up or can't sleep at night, it will be for some other irritating reason.