After you are cleared medically, they will section you for for a minimum of 72 hours where they will have a psychiatrist do an assessment. They can keep you longer if they feel it is necessary. In the US, they usually only keep you as long as your insurance will pay for it which isn't very long as mental health funding has been cut. Unfortunately you don't have any power to refuse it. If you attempt suicide, they will automatically declare you as not being of sound mind and a danger to yourself. The only chance you have of not being sectioned is if you can convince the doctor that it whatever you did was an accident, and you didn't intend to intentionally hurt or kill yourself. For example, if you took an OD, and you can convince them that you accidentally miscounted your pills and took an extra dose or something.
The type of treatment you get depends on the hospital you get sent to. Some hospitals are better than others. Mainly they don't give intensive treatment for short term stays. They only try to stabilize you so you aren't in immediate danger of killing yourself. The doctor may start you on a medication if he thinks you need it, or adjust your medication if you are already taking something. They will make you a referral to a therapist or psychiatrist before you are discharged for follow up care.