But I suppose you solution is to just kill all the refugees by letting them drown or whatever. Which, I suppose, is one way to solve a perceived "refugee crisis", but it wouldn't be my first choice.
The US has a 650 mile border wall with Mexico exactly for this reason. Most of this border barrier was actually built during the Obama administration, Trump just used it as a campaign objective to build a "big, beautiful wall" instead of a fence.
A fence does not necessarily bar a country from accepting refugees, but offers better border enforcement and so does an adequate coast guard. If a state can't even enforce its borders, there is no state to begin with. When human traffickers are discouraged, they'll look for other sources of income.
I'm not for building fences and walls, but I can't really imagine other alternatives that actually work at enforcing borders at least to some extent.