I used to just wait for the feeling to pass. Thankfully the one time I was truly depressed (due to post-traumatic stress) only lasted about a week. Nothing was enjoyable and food tasted so bland. The most exciting thing I did was probably to punch my pillow a few times.
Now I totally overthink the situation. I realised I only feel negative emotions when thinking about something from the typical/natural perspective. The trick is to step out of that and explore as many other perspectives as possible, eg. the funny side, the absurdity of the universe, how things going wrong in the short term might be best for the long term/the bigger picture. Initially I used this to sidestep lesser issues such as being overly shy. But later, and I don't necessarily recommend this as it can be quite torturous, I brutally overpondered some more difficult distress for days until I found a positive perspective to settle into. A crash course to grow mentally rather than hoping time will heal things.