Its been a year since first thought of that kind entered my mind.
3 months in at the lowest point of my life i started doing CBT focusing on habituation.
i never went to any specialist, nobody to diagnose me or prescribe medication or theraphy but nonetheless today those thoughts seem like a distant memory, sometime i miss it, the pure motivational force behind it, i've never felt anything like that in my life before or since, its terrible to have one thought in your mind 24/7.
But since then i've purposefully used habituation mechanism to curb my other anxieties, it soon became bedrock of life philosophy, a way to influence how i perceive the world, which before that seemed impossible.
When you begin it it feels awful and even more hopeless, like you are intentionally doing something bad to yourself, but as the time goes on you begin realizing that you aren't reacting to situations/thoughts and feelings that would devastate you some time before.
Only thing i can recommend is to stop wailing around and face yourself, all other things are mere ways to temporarily block it, those are things you need to avoid.
Good luck friends