How do you deal with toxic people?

I used to try to hear them out and understand their side because usually you can turn them around by just…understanding their viewpoints why they are toxic and helping them

If that is too stressful however.. i put my own mental health first and try to avoid them