A lot of science fiction about space travel brings up this issue. Sometimes it is hand waving about “shields”. The harder the sci-fi the more “realistic” the author will explain how the ship is shielded from impacts, but I don’t think I’ve ever read one that uses any technology we currently have.