The solution is simple, close the border and start deporting people who entered illegally.
You don’t need to be a rocket scientist to figure that out
Even simpler than that: shut down the availability of welfare benefits to anyone without at least a green card (personally, I'd make it so that you have to have at least 12 months of work on that green card before the welfare bennies kick in, and then they're good only for the amount of time you've worked) and then start prosecuting employers who hire those with no or demonstrably phony residence credentials.
Dry up the incentive for them to be here, and they'll deport themselves. It's been proven effective every time it's actually been tried.