What would happen to earth if the sun exploded or went out?
IF the Sun suddenly disappeared, all of the bodies circling it would take off into space on straight line trajectories tangent to the previous orbit with the same velocity they were orbiting the Sun when it disappeared. This is called conservation of angular and linear momentum and conservation of energy. The Sun and the solar system are not floating on anything. The sun is not massive enough to explode/go nova, and it is not massive enough to become a black hole. When the Sun runs out of hydrogen to fuse into helium, there will be a helium flash, then the Sun will start to expand to become a red giant or super giant star. Eventually the sun will become a white dwarf star surrounded by a planetary nebula that will slowly dissipate as the Sun orbits the center of the Milky Way Galaxy.