Dude I was locked in a ward twice, both against my will (after I inflicted self-cuts on myself). - tl;dr - it's not super nice, but it is not that bad that you imagine, either!
On the first day I got beaten by guards, on second one I was restrained with cuffs to my bed, and when I asked inmates for some water, one dude squeezed his underpants full of piss onto my face. I couldn't do nothing. When I reported it to ward staff, they told me to "stop lying, it couldn't have happened", they discredited it so badly. And I was in 24/7 monitored room (half of them were, half of them not).
It may sound terrible, but if you aren't from a third world country, and you will comply with their orders and rules - you will get an "OK" time there. Trust me. You will get meds and food every day at the same time. They will take everything from you, including shoelaces, all cosmetics, you cannot have anything you can hurt yourself with. They can search your things if your family isn't bringing anything, the visits are permitted in some time only (in my case it was 2 hours daily, between 4-6pm or so).
Hell, even smartphone was took from me (camera was forbidden, family had to get me those old phones, w/o cam).
However, I somewhat functioned there and due to constant exposure to others, the time was a bit better than I expected (i'm an introvert and prefer time alone, however the regular time schedule and other people presence - even though I HATE IT, it somewhat... took the time for me to think about how bad my depression is). It did not cure me, but i took the lock-up better than i expected it to be.
btw.
i'm from central eu, and in your case i assume you are either us/canadian or western eu, which should be even better.
don't panic, if you have several depression and suic ideation, your stay probably won't be longer than 3 weeks. I was out after 2 in both cases. Only people with active schizophrenia and delusions+hallucinations stayed longer, some for months. But it's rare.