Every once in a while, we have a celestial body that passes through our solar system. What would be needed to reel one of these in? Not crashing down to Earth, that would be bad, but say into a high earth orbit (above the satellite belt)?
There have been proposals to capture a small (boulder-sized) asteroid into Earth orbit (more or less) as several other answers have discussed. This needs a lot of planning, a big rocket and a great deal of patience, but all of the asteroids being considered already orbit the Sun, and generally are among the relatively small number of asteroids that periodically come close to Earth.
Capturing an extra-solar object like Oumuamua would be much harder. Firstly we'd need to detect it a long time (decades, ideally) before it gets anywhere near the Sun, which means spotting something that is far away, very dimly illuminated, and coming from a completely unpredictable direction. We'd want to get to it as quickly as possible, break a lump off if it was too big to redirect as a whole, and then use something, probably nuclear explosives to change the course of the lump enough for it to come close to one of the giant planets, ideally Jupiter. That encounter would have to be arranged so that the planet's gravity deflects our (now slightly radioactive) lump of rock into a closed orbit around the Sun.
Once that is done, the time pressure is off, and we can use less drastic measures (rockets, light-sails,...), over possibly many decades, to steer our target lump, via whatever gravitational slingshots seem useful until it encounters the Earth and Moon at a fairly low relative velocity. Then a combination of more rockets and the Moon's gravity and maybe aero-braking in the upper atmosphere can be used (over several passes if necessary) to actually capture it.
You could look it up :-) . The basic problem is that it takes a [bleep]-load of energy to force a distant object to stop orbiting way out there and fall towards the sun, or to be exact, towards Earth. It then takes another [bleep]-load of energy to kick it back up to the needed velocity relative to Earth to be able to orbit Earth.
To some extent, you can reduce the energy required by sending it on a slow spiral, as is more or less done when sending probes to Mars, but that leads to tens of years (at best) waiting for it to arrive.
If you're thinking of comets in their extreme elliptical orbits, well, same problem, since their path is nowhere near tangent to Earth's orbit.