Some people's brains simply need more 'looking after' physically before they can get to a good baseline where they can tackle things mentally.
That your brain is an organ, and part of your body, and its all connected.
Yes, some people can get away with a bit of exercise, an okay-ish diet, not getting good quality sleep, not drinking enough water, drinking too much caffeine etc, and also have no mental health issues whatsoever.
But we are all individuals, and just like our brains all need different things, so do our bodies. And you cant expect your brain, as part of your body, to be able to deal with the tough mental stuff, if its not getting what it needs physically. (And what your brain needs to function well and what someone else's brain needs to function well are very different) Its like expecting a smoker thats never run a day in their life to get up and be able to tackle the challenge of a 10k.
So i thought I was doing 'okay' - I wasnt completely sedentary but I didnt really exercise, I ate okayish but probably a bit too much sweet stuff, didnt drink enough water, was on less sleep but then ive always needed 8 hours and plenty of people cope well on 6 and its fine...
Turns out my body needs more, in order for my brain to be strong enough to feel well in myself, and be able to tackle challenges.
Sorting all those things out (and i by no means am a teetotal gym bunny who loves veg now! I have found balance) has changed my life.