If we are talking about clinical depression, that may require a doctor's prescription, but in the case of occasional bouts of melancholy that sometimes are just habitual responses that all of us experience from time to time, do something else.
When bouts of such depression linger, and I find myself on the pity pot, here's one thing I've done that works for me. Rather than fight it or worry about it, I give myself permission to wallow in it for a specified time, maybe 5 minutes 30 minutes, or whatever seems reasonable at the time. Just wallow guilt free until the time is up, and then do something else.
Usually, I'm done with it before the time expires. I just came up with this idea on my own. I have no idea why it works, nor to I care. Try it and see what happens.