This question carries with it immense complications owing to the Sun’s influence on the Solar System, so we’ll take a hypothetical look at it first from the perspective of the motion of bodies in the Solar System.
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.
What happens next is anyone’s guess. Some of the planets might gravitationally interact with one another, especially as the inner planets are moving faster than the outer planets and would potentially ‘catch up’ to them. Otherwise, the likelihood is all the objects would continue to move in a straight line through space out of the Solar System, and it would be many thousands of years before they came into the vicinity of another system ...