It is unfortunate that stigma around mental illness causes most people to view psychiatric hospitals as places to avoid at all cost, as they have a stigma so terrible going to one is like dying multiple deaths. After that you're 'legally' crazy (whatever the fuck that means)!
In fact, if you need one, if you are severely depressed or hallucinating, a hospital is exactly the place for you. You will most likely love it there. They can help. They can really help. Everyone gets better in the hospital. Everyone. Not "1/3 get better, 1/3 stay the same, 1/3 get worse." Everyone in that sheltered environment rapidly improves. It is a vacation for the mind.
The question then becomes staying out of the hospital. Many people come back every few years, get to know the staff quite well, etc. Others develop a plan to address mounting depression early through ongoing treatment, partial hospitalization, etc.