I'm not an INTP so ymmv. So, you think you're depressed so maybe you are, and maybe you know why. Knowing, half the battle, red lasers, blue lasers and all that so....
0) Own it. Only you can fix you.
1) I try to get my mind OFF it, whatever it is - usually I know why or what and to avoid totally spinning out on it I need to be HEAVILY distracted or any spare cycles in my mind are consumed with whatever it is that is bothering me and I kind of lock up. Work, hobby, new hobby, research something.
2) Alienate everyone around me (quietly and passively unless they need to be overtly hated on), so I don't waste time thinking about their "stuff" - they are not necessarily the distraction I am seeking in #1.
3) Flee. One time I moved across town for a bit of a reset. That got me far enough out of my original
(problematic?) context to re-frame some stuff and maaaaaaybe even overcome the root cause of my problem (or more likely just repress it until it comes back later with a vengeance).
4). Call yourself out when you're being a pussy about it ("be mindful"). Once I have identified that I am falling into that state regularly I tend to be able to tell when it's starting. Wherever I am, whatever I am doing at the time I will stop for an instant and tell myself either in my mind, or aloud "You're doing it again, stop it.", as though I were speaking to someone else. Like... I'm in the shower, which is a danger zone for my train of thought, and as soon a I feel myself slipping into the loop I point it out to myself, have a very brief " Oh... Yeah I am..." moment and then stuff gets normal for a few minutes until I slip again. Lather, rinse, repeat.
Eventually I will have to figure out how to overcome the "why" or it goes on and on... in the past this seems to happen unconsciously... like I may have managed to stay so distracted from it that it just goes away? It's not like I have REAL problems... just first world white trash annoying pussy shit that really doesn't matter at the end of the day and I'm wasting grey matter on it; life only gets shorter.
If you're "really" depressed and it's controlling you and you can't curb its teeth out after a while then probably you need to consider real support. I think for a lot of people they just need to deliberately help themselves instead of looking to pharma solutions to problems created by broken culture. In the same breath there are those who probably need "treatment" to break out.
Hell... I don't even know if any of the above is working for for me, even, but you asked and here it is FWIW.
Good luck, and mind your mindfulness.