I'm not sure what other people call it, but my family calls it the downard spiral of doom. It's a faulty thought process that you can't break out of on your own. When in the downard spiral of doom, you can't just "think yourself better." It doesn't work that way. Your stuck in the spiral and very few things can get you out of it. Sometimes sleep will break the spiral; sometimes it won't.  It has many variations, but here's one example.

Downard Spiral of Doom
I'm lonely. That's because I don't have any friends. I don't have any friends because I'm ugly and mean and people don't like me. I try to be nice to other people, but they still don't like me. Everyone hates me. I hate me. Why do I bother? Why am I here? I don't deserve to be alive. I don't deserve to have people that care for me. I really should try harder. But I can't. I just don't have the energy. Maybe, maybe I should just kill myself.