The best way to get rid of depressed emotions or to boost your ego is to do sports. I got the consequence from my experiences many times and it has proven to be true time and time again.
Often we encounter bad or hard things in life or work that we can't deal with successfully, we might get stuck and become nervous, if we are under stress for a long time, our ego or emotions would be hit to a low level, or even we would get sick.
In this situation, you should temporarily stop it, go to the gym, run on the treadmill, or do other sports, stop thinking about anything else, keep the empty of mind for a while, you will get a refreshed and energetic mind.
Maybe this is referred as "动则生阳" in Chinese medicine, meaning that moving can generate energy or something like that. It is helpful.