The Danger from Supernovae
When a massive star reaches the end of its life, it collapses suddenly. The collapses generates a shock wave. The outer layers of the stars are thrown off in a massive explosion. The star may shine as brightly as a whole galaxy for a while.
Because the power radiated by the star is massive, life on any nearby system may be at risk. If a star were to explode as a supernova one light year away from Earth force of the shockwaves would easily destroy the Earth and Sun and leave our solar system as a nebula remnant that would eventually lead to the formation of new stars and planets.
The closest star to Earth is Proxima Centauri, a red dwarf or small star just over four light years away. Proxima Centauri will never become a Supernova since it is too small. The further away from us a supernova is, the less effect it has on us.
Because stars are moving relative to us all the time, it is a possible supernova may happen much closer several to us billion years in the future. If one did so about 50 light years from Earth, it is likely that it would destroy the ozone on Earth, in turn also destroying the Earth’s magnetic field and leaving us exposed to a lot of dangerous radiation.