Eventually I think the best coping mechanism is a hobby. Your interests will always nurse you back to joy. Reading, writing, playing a sport - find something that brings joy, then spend enough time nurturing it. Rely on it to always help you find your way back.
Major cheat code for life: Assume good things are still ahead. You are not behind. You are not too late. You are not disqualified by your past. One new season can change the entire story. Keep showing up with belief. The best chapters are often written after the hardest ones.