How to deal with failure?...

I’ve been suffering with depression and anxiety for most of my life. I’m in uni and I just feel like such a failure compared to everyone else. I came into college feeling so motivated being pre med. it started off with one failure after the other and since then almost 3 years have past and I’ve been teetering between 2.8-3.0 gpa I’m trying to get my grades up I even decided to drop the pre med classes. I had to withdraw from my classes twice because I was diagnosed with Lymes disease that year. And now even when I’m taking easy classes I still getting Bs B-‘s (which is better than before but not where I want to be) and when I see people around me doing so much better than me I just fall in this state of extreme depression and feel so worthless and stupid then I can’t focus on anything and it’s been getting worse I just don’t know what to do I try to hope that there really is light at the end of the tunnel but I just don’t see it anymore I know being a physician is way out of reach at this point and I don’t know what else I could do with my life that was my only real passion and just knowing that I’ll never be able to make my dreams come true is very heartbreaking and I only have another year left before I graduate but I feel like I’m such a failure compared to the people I’m around, I have no social life no friends and I don’t know how to deal with this much loneliness and disappointment