Depressed because the stuff i caused

My depression was already acting up but someone who texted me yesterday made it worst...so bad that i stayed home from school just to avoid people and not have to struggle with not breaking down and failing miserably again... And i know that what the person over text said was more than likely my own fault...

I had been friends with someone who is transgender, lets called them H, and they would just harrass me a lot to the extent I cried a lot..for some reason, i never understood why... Then a couple of people, lets just name them Z and Y. Told me to become friends with them so H would stop harrassing me so much ..so I did. They seemed nice at first and i thought i finally found my own crowd within the first few weeks. Y was nicer to me than Z was so I liked Y a lot better than Z...But eventually they started gossiping and pressuring me into telling them my secrets when i never pressured them for answers.. It made me severly uneasy...and when i would ask for them to stop they would continue... They would start talking badly about H because it turned out H liked me a lot.. They pressured me into listening and joining them..they made me stay away from people they've done bad things to and to H as well..everytime i felt uncomfortable the way they spoke about them i would try to get up and leave they would stare me wrongly and get outraged that i went away or talked to the people they were saying bad things to about irrelevant subjects...yes i know it was horrible of me to be doing what they were doing... Later i became interested in my religion and saw that all the bad things Z, Y, their table, and I have been doing or saying was wrong, very wrong and that instead they should be doing the oppisite.. So within time I started becoming friendlier with H...y and z began giving bad stares like"we're gonna get you next" it made me frightened to the point i would cry and when my bestfriend found out she got upset at them..they started picking on H and it got to me... I felt awful because of everything i had done and said...I began to change my ways to doing whats right in my religion.. I made new friends and kept my distance from them to avoid any conflicts with Y and Z...Eventually when i thought things cleared up when i would walk past the halls they would hint keywords about the secrets ive told them, making me scared that they would tell others... I broke down again.. They continued my new friends got upset and asked me Whats wrong. Because i didnt want them to be upset and worried all the time I told them..When i told them , it suddenly became worst...somehow the situation got bigger...into drama...turns out Z did some bad thibgs to some of my friends...i still kept my distance and tried to keep myself together and continue to pursue what i thought was right.. Then Y's birthday was coming up and i made Y something, in hopes that Y would like it. I planned to give it anonymously...so I did.. Turns out Y liked it, and asked people who its from. H recognized my writing and said it was from me...then I get a message from Y that said thanks...but I get a message from Z saying "why do you hate me" I didnt hate Z i disliked their actions...i told them that statement and i also said that i was just trying to keep my distance and they said i was lying... I wasnt.. I told them i wasnt and my reason for keeping my distance...the reason was because I changed, i was scared of them getting mad, because i didnt want drama, because i didnt want people to get hurt anymore... They said I was playing "innocent" and that i did things to hurt them... I didnt know what Z meant.. They said that I caused a whole lot of stuff to go bad for them... They got yelled at by my friends' friends, my friends gave them stares, that I apperently gave them stares, that I "told people to do this", that i "told people to make them feel bad", i made y feel uncomfortable, i made them feel like shit, that i ruined their reputation... I honestly didnt mean to cause all that...all i even did was keep my distance and told my friends why i was upset which is a normal thing to do because youre supposed to vent to friends about somethings that bother you and its supposed to be confedential... Knowing that I didnt do this purposefully i told them that and that i was sorry that i caused all this... They said " I was trying to fix all this with you but it looks like im the only one trying to fix this because you keep pretending it wasnt you. It only bothered you.Bad things happen when youre quiet or loud about it. So dont say it was unintentional. Its totally fine what you did, dont say it was unintentional because you just keep acting like it wasnt you. That makes you bad"

After reading that... I got another message from H, with things Z had leaked in our conversation... Right then i felt like the most useless piece of utter shit in the world...I didnt mean to cause anyone harm i didnt mean to give people drama, i didnt mean to make them feel that way... I didnt mean to be the worst person in the world... I just wanted to keep my distance cause i was scared and didnt want this to happen...it hit me hard, i cried all night... and i nearly decided to suicide to get away from it because its all my fault, but i just took some sleeping meds to sleep so i wouldnt think about it and wouldnt get so upset to the point i do something stupid that i will regret once im dead.. And i still feel like crap....all the thibgs ive said was horrible and im a horrible person bo matter how much I try to change... I just want some advice in what to do in the situation because i know there's still hope and something i can do instead of runaway from life..