I've dealt with this exact issue in my life before. Here's a few of my recommendations.
If homelessness is an issue, get any income you can. Whatever job you can get to get your bills paid, take out loans, credit cards do what you gotta do to take care of yourself. Every time you go to that job, no matter how you feel about it, tell yourself, this is the first step forward. This is me taking care of myself.
There are a lot of free resources in most cities. Sometimes talking to a social worker is completely free and can be very helpful. Talking to an external non bias source who has "no skin in the game" can be profound.
Somethings to consider:
How much sleep are you getting?
If it's on the low side (under 6 hours) this will greatly contribute to depressive thoughts or moods. Typically sleep can move you into better mental health than medication can.
How regular is your sleep? Are you falling asleep/waking up at the same time everyday?
If this is varying wildly it will throw your circadian rhythm off and your sleep will be of poorer quality, which will worsen your mood.
How much physical exercise are you getting?
Physical exercise has been shown to release a whole range of chemicals that will affect your mood. Try to get at least 20m of rigorous exercise a day no matter what. I prefer in the morning right after waking up. There's less resistance at that time and afterwards you can open yourself up to whatever you want to do with the rest of your day knowing you've taken care of yourself. I prefer yoga specifically this youtuber: https://www.youtube.com/user/yogawithadriene Her "TRUE" and "DEDICATE" series have helped me greatly both physically and mentally.
Have you considered medication?
Most people are very hesitant to go on an antidepressant or mood regulator. There's a lot of stigma that surrounds it. But at the worst you try one for a month and decide its not working and move on. The alternative (suicide) IS FAR WORSE and permanent. Please consider medication prior to any final step. There's a whole range that can be prescribed that can affect you differently, some can make you sleepy after taking them some can make you feel more awake. Talk to your primary care physician. They can typically administer a questionnaire and ask some supplemental questions that will help narrow down what will work for you. Don't let the medical cost be prohibitive. Typically this medication is cheap and can be prescribed after just an initial visit. Also request a full blood work up to check your Vitamin D and B and B12 levels, all these greatly contribute to depressed moods.
Finally I'll recommend a book that has helped me break away from the idea that I am what I feel/how I feel. https://www.amazon.com/Mindful-Way-Through-Depression-Unhapp...
I hope this helps. You're not alone. Many have been in your shoes. Take care of yourself friend.