It sounds like you are suffering a mentally illness. You need to see a doctor and get medication for it. What city are you in? If you leave a question at Ask MetaFilter and Reddit about where to find financial aid and resources for someone in your city, you can get lots of answers.
In fact, there may already be answers you need there. Do some searches and check it out.
Look, I have been homeless several times in my adult life (I'm now 40). You can survive and get out, but you need to get help for your mental condition first. That should be your #1 priority.
Please: get treatment for your mental condition ASAP. You need a functioning mind to navigate your life to a better place.