We would know immediately if the sun vanished, because the earth would be flung out of its orbit. The sun’s gravitation, which keeps the planets in their elliptical orbits, is not relative to the speed of light. That’s part of the thought experiment that led Einstein to postulate his theory of space-time.
Assuming we were still alive to observe it (and still in the same orbit — which we decidedly would NOT be), the light from the sun would expire about 8.3 minutes after the sun did.
Suddenly displacing one of two gravitoelectrically interacting particles would, after a delay corresponding to lightspeed, cause the other to feel the displaced particle's absence: accelerations due to the change in quadrupole moment of star systems, like the HulseTaylor binary have removed much energy (almost 2% of the energy of our own Sun's output) as gravitational waves, which would theoretically travel at the speed of light.