If you go to the ER for mental health the ER will evaluate you and your mental health and then determine whether or not you need to be admitted to the hospitals mental health ward.
If your mental health is severe enough and the hospital staff thinks you may be a threat to yourself or others then they will hold you in the mental health ward.
The mental health ward is kind of like a prison inside the hospital where they will keep you and guard you and prevent you from leaving.
If your mental health is not severe enough then they may decide to discharge you and send you home and have you follow up with a mental health professional.
You should only go to the ER for mental health if you think you are gonna do something bad.
Otherwise make an appointment with a mental health professional to talk to you about your mental health.