First off, it sucks that you're feeling this way. That level of low seems incredibly unfair when you're there and understandably hard even when you manage to crawl out because it goes with you. I have some questions for you.
What's your school situation like? Is it a college or a tech? Are there people your age? Do you glance around or notice interesting people even if you don't feel any drive to talk to them? How good are you at instigating? How much sleep are you managing to get? Do you have any family members you could talk to for encouragement? If you feel that you're a mistake and don't matter what do you think makes people matter?
I'm not going to tell you to do something you'll be uncomfortable doing. When I was in a similar state people were pressuring me to go out more. Anywhere. Which was awful, as you can imagine, since most people go out with couples and groups which is the last thing you want to see when you feel alone which was bad enough after shift involving husbands wives and kids for eight hours. But, school at face value is opportunity, and anyone's a potential conversation. I'm ****-for-nothing-good at making friends (most the people I hang out with now are past employees or friends of friends that're now just friends) but I'm good with people and everything's chalked up to how others interpret what you say. Do you think you could try striking up one conversation at school a day? The hardest part of losing friends is the comfort and definition they gave you. It's like being bare. And meeting new people is difficult, and I know it can feel wrong compared to what you're used to, but it can turn into something new and oddly better. When I lost my friend of over ten years, along with all my other long-term friends, I never thought I'd be able to trust someone again or feel that level of connection, trust, or personal intimacy. It can happen again with the right people and the right level of acceptance.
Sorry for the tedious questioning by the way and I hope the feeling passes.