quoted from stack
In real life, the issue would not be rocks or even dust particles, but single atoms. The presence of a small but not insignificant number of atoms/ions/molecules in any volume of space would create enormous amounts of both friction and radiation for any vessel traveling at that speed.
The best solution I've seen that is physically realistic is a large (1000's of km in extent) magnetic field and a laser/EM beam sufficiently strong to ionize any matter in front of the vessel. Once ionized, the gas/dust will be affected by the magnetic field and can be funneled either A) into the ship's engines for fuel, as in the Bussard ramjet or B) around the vessel.
Larger objects are extremely sparse in the universe and if you happen to come across one, realistically speaking, you're dead. It's unlikely that you will, but not impossible. Very large objects could be seen using a telescope and navigated around.