Your basic needs for food and shelter and meds have to be met. Have you heard of Maslow's Hierachy of Needs?
You need help from a social worker/case manager to get you set up with housing, income, insurance, etc., so the stress and dp/dr and SI goes away. Then you need a healthy lifestyle routine to be in place.
When I was in hospital IP, I felt like I could've run a multi-million dollar company out of the little room in the corner.
But, then after being stabilized and released into "real life" I didn't do so well.
One thing I learned is that one needs a lot of supports coming out of hospital to prevent relapse.