You can't fully fix homelessness unless you also accept that some people would need to be forcibly removed and put into treatment, which most people who claim to want to end homelessness are against.
No matter how many programs and funding, you'll have the small percentage that is mentally ill/violent/unwilling to receive help.
So here’s two solutions to the problem you’ve outlined:
Housing First - which is a policy that prioritises putting a person in a house above all else even if they are unwell.
Supported Accommodation - it’s a service where people who need extra support (like people with mental health issues) can live in a close knit community that has access to health services.
The number of people who you’re talking about in either of these categories though is quite small compared to the majority of homeless people who have jobs and are just unable to afford a home.
Right but that's what I'm saying, my city does ok providing for people in need, but our issue is that we have mentally ill and downright at times dangerous people who are known to everyone. But we can't forcibly remove them and throwing them in jail does no good, so they're allowed to kinda terrorize people, and we all deal with it.
I don’t know the specific laws in your country but in mine if someone is having an acute mental crisis they can be given an Involuntary Patient Order which means they have to stay at a hospital.
These laws already exist where I am, I don’t see the connection between accepting they exist and that they are necessary to solve homelessness.