I have been hospitalized in a psychiatric hospital 6-7 times, and from my experience, mental stability requires "preparation" and "familiarity."
Preparation means having backups for unexpected situations, like having extra sleeping pills to prevent seizures caused by insomnia from unexpected awakenings.
Familiarity involves staying calm no matter what I see online or getting used to work so that I feel less tired.