Make housing affordable with denser mixed-use zoning: You solved 50% of the problem. Make public transport convenient. You solved another 30%. People needs to be able to stay frugal in rough times and socialize. It feels to me that many US cities make this impossible. If you had Spain levels of unemployment I have no idea how would you do.
Let's ignore that almost 100% of the homeless population in America is addicted to drugs. Having experienced drug abuse myself I know for a fact affordable housing is not going to do anything for these folks. They need treatment, and that unfortunately doesn't happen voluntarily when you are sick.
But this is an important point: there is a real homelessness problem in the USA, but there is also a mental illness/drug addiction problem that often co-exists with homelessness (some say that being homeless causes one to become an addict eventually, but that is controversial).