Replaying "stressful" events

I regularly experience a kind of ‘post-traumatic stress’ after an event that I’m particularly anxious about, like public speaking. I replay it over and over in my brain usually with a lot of judgment so it’s painful and exhausting. It’s happened enough times that I know exactly what’s going on. I don’t think I resist it. It takes a couple of days for my brain to settle down. During that time I usually have a lot of trouble sleeping, because my brain is so active. Intellectually, I get that it’s not useful, but the way I experience it feels almost involuntary. Trying to offer my brain some more useful thoughts helps a little, but it’s as if my brain has to work through it. I know to expect it and hold space for myself but it’s super uncomfortable and draining. Is there anything I can do to interrupt or avoid all the looping? The model is always something like this:

C: I said the words “………….” at public event
T: I messed up
F: Shame
A: Withdraw, brain is looping, making it mean I’m not competent enough, notice ways I messed up
R: Messing up now

So grateful for any suggestions!