The first step would be to acknowledge a problem exists. something the current administration has been loath to do.
Short term measures would be to reinstate the remain-in-Mexico policy for asylum seekers, and to use the National Guard if necessary to control the southern border. Additional steps would include properly funding of the border patrol agencies and construction of barriers where practical.
The long term measure, and the one that matters the most, would be to address the issues that make Mexican citizens want to leave their native land in the first place. While it is not the U.S. 's responsibility to "fix Mexico", it is in our own best interests to work with the Mexican government to weaken the drug cartels wherever and however possible, remove corrupt officials from the Mexican government and law enforcement, and generally improve the quality of life for everyday Mexican citizens. This is all far easier said than done, and would require enormous investment as well as resolve...Without it, however, our neighbors to the south will continue to flood our border, and barriers and personnel can only do so much to restrain them.
If there is a better and more humane way, I'm all ears.
My two cents.