Anything in orbit around the Sun is basically moving fast enough to be in a constant state of freefall towards it. If the planets, for example, suddenly stopped moving they would immediately be pulled towards the Sun and fall into it.
So, let’s imagine that, due to some unknown reason, our Sun suddenly vanished. In this instance all the planets, asteroids, comets and whatever else would retain their forward motion. Therefore, rather than fall towards the now nonexistent Sun, they would fly off in a straight line into space.