Not one thing is the cure all. It takes a fence, it takes agents, cameras, and enforcement. The biggest part is probably keeping them from working when they get here. If they can't work they will self deport and won't come.
If we need cheap labor then change the immigration system to allow them to come in legally.