Well in my state involuntary commitment and forced meds are two different balls of wax. As far as "involuntary", a police officer, psychologist, or psychiatrist can initiate an emergency petition for the person to he evaluated in the ER. Anyone other than that can go before a judge and make their case why someone should be petitioned. Then the police pick them up, handcuffing them if they have to, take them to the ER and then they are evaluated.
In the ER, the crisis team decides if the pt meets criterea for inpt. If so, a voluntary admission is offered. If the person can't or won't sign voluntary, 2 doctors have to "certify" them, meaning agree the pt is mentally ill and there is no least restrictive method to keep the pt/public safe. Them they are signed in involuntary. Any involuntary pt has to have a hearing within 10 days to determine if they need to he committed or not. For that, the public defender comes to represent the pt, and an administrative law judge determines if the person needs continued involuntary treatment or that they should be discharged. If the latter, they are immediately discharged. Even if they get committed, they still have the right to refuse meds.
If the pt is really sick and refusing meds, you would "med panel" them, meaning a judge gets involved again to determine if the person should be medicated against their will or not. At that time, the doctor is expected to give a list of the medications he/she plans to initiate. After that, a pt has the right to appeal the decision for 48 hours. After that's up, or they lose an appeal, we start IMing if they refuse PO.