Counter-acting this negative train of thought is a goal of Cognitive Behavioral Therapy for depression, and it's very successful. But also way more expensive than pills.
I had an interesting experience with this a few years ago when I went through some pretty bad depression and anxiety. My first step of getting better was rejecting the bad feelings saying to myself "These feelings don't make sense. Stop feeling them" and that made me feel a bit better. But to really improve I had to make the realization that the feelings are a part of myself even if I don't want them to be, and that I can do better even if I don't feel good.