When an illegal immigrant commits a crime, send him back to his country of origin. Make life difficult for those who are here illegally. Make it easy, even profitable for illegals to self-deport. Even set up a system for illegals to become legal if they meet relative high qualifying standards and squeeze those who do not qualify. Punish countries who are encouraging and enabling illegal immigration, particularly Mexico.
It will take time but it is possible.