It depends on the mental illness.
When If failed to ctb, I was forced to live with my parents again and here's the thing: my mother has schizophrenia. She becomes literally a monster and thinks people (including my dad and me) want to kill her.
What did I do? I just tried to ignore her and do whatever she wanted me to but there were times in which I just went mad and we ended up insulting each other lots.
What advice can I give you?
As it was said above, just get out of there but try to get them professional help. My mother didn't want to go neither to therapy nor to a psychiatrist and sending her against her will, here in Argentina, it's almost impossible.
If you have no choice but to live with them, whenever you go mad or sad, just try to remember they're "sick". Only meds can help them but treating them with love and respect always helps.