As others have said, there's a feedback loop but it starts with mental health. Physical health isn't something that just happens - it's an accumulation of lifestyle habits over many years. You don't have to be in fitness model shape but if you lack the mental discipline to stay functional via a modicum of sleep, diet and exercise, your body is going to look and feel like shit which will lead to mental decline. Your brain is part of your body and it can't be happy if your body is pissed at it for making shit lifestyle choices.