Hi, I can speak on this because I have been through this process! I have my own studio apartment that I got by going thru a rehab program, a halfway house for a year after that until I got permanent subsidized housing. please note that your experience may differ greatly from mine as these programs vary from county to county as well as from state to state but you will have the best luck in wealthy liberal urban areas particularly on the west coast as the urban counties in those states have the best funded programs with the lowest barrier to entry. if you are willing to move locations & start somewhere new do some research but cities that homeless ppl flock to are a good place to start. there a ton of hacks & workarounds to getting prioritized for these programs as there are waiting lists everywhere, especially places that have good housing programs. appearing homeless is a good way to get priority, all you have to do is spend one night in a shelter and change your mailing address there. the shelter can then give you a letter stating proof of homelessness. (there are other way too) this will get you priority and get you in the door at a rehab program though you may still have to wait/try more than once. when I did this process I actually was homeless (sleeping in a van) and a heroin addict and I got a shit ton of info on how to make the system work to your benifit from other junkies and homeless ppl. you could try talking to some ppl in your area for tips, homeless ppl are the least often judgmental ppl you could possibly meet and will tell you all the tricks they know if you smoke some weed with them or buy em smth to eat. if you look down and out too and you can make some small talk they'll tell you for free and hell you might make a friend!
above all taking this route requires you to be able to extensively navigate bureaucracies at a high lvl of difficulty and to tolerate a ton of bullshit from everyone from caseworkers to roommates as you'll be shoved in a room with a stranger who's likely kicking hard drugs.
If you guys want I can keep going on how do it and tricks you can use to get the system to help you when it most certainly doesn't want to, just lmk and I'll write it up :)