Do you see a therapist? Is there someone whose judgment you trust?
Some people make a plan with a therapist/other, outlining under which circumstances hospitalization is likely to be helpful. This can help both you and the person(s) you trust to determine when you are most likely in need of a safe place.
I think it's difficult for everyone to give up freedom(s). Sometimes it's the lesser of two evils.
It's important to always stay safe.

WC