Constant replaying of events in my head make me feel like shit.

We just lost a house because our financing fell through and I’ve cried, I’ve let myself feel the disappointment, but one of the things that keeps happening is I keep replaying the mistakes that led to the fall out in my head – which in turn is keeping me in this cycle of feeling like shit. Any advice to stop replaying things over and over again ?