One thing that helped me was seeing depressed thoughts as transient entities, not belonging to me, but just passing through my mind once and a while.
It's like a weird dream. If you have a weird dream, you don't think, "oh I'm weird", you think, "that was a weird dream". It's the same with depressed thoughts: if you see them as "oh that's a depressing thought", rather than, "I'm depressing", then it's easier for those thoughts to go away. (usually when your blood sugar goes up or something like that)