As a severely mentally ill person myself, there’s something I want to say:
You’re not responsible for your mentally ill friend/partner/relatives recovery.
You can’t cure your mentally ill loved one’s mental illness and you shouldn’t be expected to.
If they’re hurting or scaring you by acting out, having episodes, yelling at you, manipulating you, guilt tripping you, lashing out at you, etc, you’re allowed to put yourself first and distance yourself - yes, even if they aren’t doing it on purpose. Even if they don’t mean to. Even if they’re remorseful. Even if they love you and you love them.
You aren’t responsible for their mental health and you’re allowed to distance yourself, put up boundaries, take a step back, end the relationship, etc, if their mental illness is affecting you negatively.