If all planets were to suddenly stop orbiting the sun they would be pulled toward the sun. However, if the sun were to suddenly vanish then all the planets would retain their forward motion and be pulled in a straight line into space along with any asteroids and comets. Once out in space, the planets would go in that straight line for many thousands of years until going into another solar system. Unless they crash into something like another one of the planets that used to orbit our sun as well.