What country do you live in? Are you aware of the services available to a low income person? Food benefits, housing, medical, therapy, these are all things you should be acting on because things get a lot harder when you don't have easy access to a computer or phone. Often times people are only homeless because they are unaware of the services they can apply for or they become accepting of their fate as it is. But it takes time, if you know you are about to be in a bad way you should be preparing as best as you can so that you are not homeless, without food, shoes, ect. You might even have to travel to a more middle sized city, not too populated where services are tapped out but not too small to where there would not be any services available. Try to apply for something like section 8 housing, you can increase your chance of placement also if you are willing to relocate.
It takes work but anything is better than sleeping in parks, eating food stolen from stores, bathing in taco bell bathrooms, and just overall being concerned about where the next meal will come from or your access to water. I only spent 3 weeks doing that for a reason! Because it's a terrible way to live.