> Build houses.
That doesn't solve homelessness, as we build many houses in America but they aren't being filled with the homeless. You need to apply social services in a complex systematic approach to provide housing that people can afford sustainably, and rehabilitate and integrate people into society. You might think that is a bit of a bad faith "gotcha" like, of course you have to make the housing free and ensure homeless people know it's available. But it's not a small detail to elide, even in context, and doing so is exactly why your thinking is off-base. You haven't even begun to unpack it properly, putting aside the falsehoods. Think about it, what do you do if someone doesn't want to accept the housing for complex reasons like pride or embarrassment? What if it's some crust punk kid riding suicide as a rite of passage? You have to deal with a lot of that! You can't just ignore it!
> Get people clean, harsh sentences for dealing.
Punitive measures have proven to be a complete and total failure globally. Even in Asia, where penalties on all sides of the drug trade are high, drug usage is very easy to find and rising. I say this as someone connected to Asia and with a fair amount of "street smarts" that some seem to lack. Japan and Korea don't even try to hide it anymore. Chinese cities are kept clean through a complex system of travel controls and consistent policing to sweep things under the rug. It's easy to score if you pass as Chinese outside of the tier 1 and 2 cities though. Even Saudi Arabia is flooded with black market drugs if you know where to look. Punitive measures empirically do not work.
> Violent extremism? Jail
Where is that not the case? Like what are you talking about? Do you know how common attempted domestic terrorism was against the US power grid and cell towers in 2020/2021? No, you don't. Almost nobody does, and certainly nobody has an exact number. That's because it was kept very quiet and the thousands of incidents were suppressed from the media cycle while the people involved were quietly thrown into the maximum security incarceration hole never to be seen again.
The person you're replying to is right. These issues are solved, and it means looking at why people want to do any of this to begin with and addressing that. You cut it off at the behavioral source. Think of it like this, do you check every pointer before you dereference it? No. You avoid bad pointer dereferences primarily through proper structure of your code.
You almost tap into this with being cognizant of the fact that it's not universal. It depends greatly on the country and culture. Because some countries and cultures have done a much better job at building worthwhile, healthy societies than others.