I have been in similar and I employed a private therapist for 2 months in run up to me quitting, just to try and bolster myself up mentally. Therapist thought the situation was disgraceful.
I was so stressed and unfortunately live rural so even driving for 30 minutes radius job were not abundant so had limited options.
I ended up resigning, my team and my manager were toxic as they come.
My mind wanted to keep going but my body had other ideas and I developed insomnia. I resigned on a Thursday to senior manager who tried her best to get me to stay and after a long and open chat I agreed to stay on.
The following Friday I literally handed in my notice, explained I was regretful to leave under the circumstances etc etc and walked out as I was getting targeted by the team, workwise after the senior manager tried to rein them in.
Senior manager wrote me a very nice goodbye email, saying the understand, wish me the best, they will support me with a reference, sorry to see me go etc etc.
It was a great job and. I was good at it. But my mind and soul couldn't cope being around black hearted toxic people any longer.
Good luck x