I can't overstate how much getting fit helped me. I absolutely still get burned out, with the same depression, anxiety, and existential malaise, but the lows are never as low, and it is always much, much easier to bounce back.
I don't know how much of it is a purely psychological sense of resilience you build up by regularly putting yourself through difficult physical stressors in small doses, and how much of it is from physical changes that (presumably) improve your autonomic function and balance... but whatever it is, it's been life changing, going on about 10+ years now, depending how I count it.