And how did you conclude that you don't have depression? There are many types of depression, and if the loss of a job was enough to make you want to die -- you were depressed. And even for short-term situational depression, medication can help. And yes, they can hold you in psych until they are convinced that you are no longer an immediate danger to yourself, and that you have lined up outpatient support and treatment.
You are out now, so do what you have to do. Find a new job, take your meds, work with your therapist and psychiatrist, and get to where THEY will agree that you are no longer a danger to yourself.