As a person with depression I really, truly wish I could just choose to be happy.
I know it may not mean much from a random internet stranger, but some of the things we talk about in my family, to avoid some of the potential mental issues, are: never get too tired, too hungry or too lonely. The list should probably include some other things like never get too sedentary, but we've tended to talk about exercise seperately. These I've found are necessary, though maybe not sufficient for good mental health.
Sadly, most of this advice is to avoid the deep spiral which can be incredibly hard to come back from. Mental health is hard, and taking care of yourself can be much harder than people make it to be. Please take care of yourself as best you can.