I think I have been doing a great job keeping my spirit up lately. I exercise a lot. I give myself a good amount of time to relax after working hard. Having a partner and good friends around helps. It is still veeery easy to succumb to depression and I can totally see how that could happen to so many scholars and students.
The best and worst part of being an academic researcher is that you are almost completely on your own. Yes you have advisors and institutions, but you can go several years without exchanging a word with any of them.
Actually it is better if you are only on your own. Once you are surrounded by those with a similar level of qualifications who have “a real job” and “real salary,” you might start questioning where all the hard work you have put into disappeared without monetary compensation. Not that you want to make money, but where could you find satisfaction in your accomplishment?
Then that feeling makes you more sensitive to your reputation, and it becomes more painful to interact with other scholars, or especially to get to know scholars. They easily pass judgment on you, because giving a judgment is part of their job. But it also makes people defensive to each other, increasing the stress level up high.
This is the trap I think we could fall into. At each stage we can just take a deep breath and objectify how this pattern is taking place. Deep breath. Back to work.