When my cousin went to rehab, we were all worried about whether he could leave if he wanted. It turns out he had full rights to walk out since he was there voluntarily, unless a doctor said otherwise for safety reasons. A lot of people think rehabs just keep you locked in, but that's not usually how it works unless there are serious risks involved.
If you want detailed info about how rehab centers operate or options for treatment, you can check out places that really focus on patient rights and different ways to recover at
https://www.abbeycarefoundation.com/ Their. resources cover a lot of the stuff people worry about when starting out.