This is exactly how you deal; you choose your own well-being and peace over maintaining toxic relationships. And sure, some (most?) friendships will fall away if you've allowed toxic people into your life over a long period of time with no boundary enforcement, but that just makes room for new people who will respect you and your boundaries.