My friends keep saying outright hateful things and idk what to do

My friends at school keep making incredibly homophobic jokes, claiming LGBTQ+ is all mental illness, and just being insanely hateful for no reason. The other day one of them literally told me directly how he wanted to beat up trans ppl, and the same person was making fun of another kid who had a panic attack during class. I don't know how I managed to become friends with such terrible people but it's taking a toll on my mental health and idk what to do about it. I can't just ditch them cuz they'd probably start bullying me if I did that, plus they're the only people I know and it's literally impossible for me to socialize with people I don't know

My friends at school keep making incredibly homophobic jokes, claiming LGBTQ+ is all mental illness, and just being insanely hateful for no reason. The other day one of them literally told me directly how he wanted to beat up trans ppl, and the same person was making fun of another kid who had a panic attack during class. I don't know how I managed to become friends with such terrible people but it's taking a toll on my mental health and idk what to do about it. I can't just ditch them cuz they'd probably start bullying me if I did that, plus they're the only people I know and it's literally impossible for me to socialize with people I don't know