Friendship troubles

Sarah • Married to my best friend for over 3 years and we're now proud parents to a sweet boy and another baby boy on the way! 🌈👶🏼
So I have a question for anyone that may have a negative friendship in your life, either now or previously and what have you done to help it to either not effect you anymore or to remove it? I have a friend that is very up and down and when she's up she's the greatest friend, truly, but when she's down, twists everything I say around so that I have to choose my words very carefully and walk on eggshells. It makes me feel like a horrible friend and I know in my heart it's not the case.
 I can no longer ask my husband or other friends what to do because this has now been going on for a few years and they are done with her. I am a very loyal friend and can't just say goodbye when she goes through her tough times.
 What to do? Thank you :)