In “Why We Sleep” by Harvard sleep researcher Matthew Walker, he says that during REM sleep your brain revisits emotional experiences but in a chemically safe environment. Stress-related chemicals like noradrenaline are greatly reduced so you can replay difficult or painful memories but without the full emotional intensity you felt at the time. The brain can process and “defuse” those emotions.
TLDR, sleeping on it works.