Homelessness is a complicated issue but the core of the solution is very simple: Provide housing. Whether that is a short term stay in a shelter or a lifelong stay in permanent housing is going to depend on the individual. But either way, you need a safe place to sleep and live before you can start seriously addressing other problems.