Could a Supernova Destroy Life on Earth?
The short answer is yes, but the long answer is that it's highly unlikely. A supernova (an exploding massive star) located close enough to Earth would create a burst of high-intensity gamma rays, which would rapidly strip the ozone layer. The radiation would set off a chemical reactions in the upper atmosphere that would turn a large portion of or the entirety of the ozone layer into nitric oxide.
This would allow UV to reach Earth's surface with an unprecedented intensity. This could cause serious injury to nearly all life forms, which would lead to a mass extinction that Earth may never recover from. In addition, the cosmic rays could strip the atmosphere away if the supernova were close enough to the Earth. This would leave it airless, waterless and more like the moon than present day Earth.
This would make it impossible for life as we know it to exist. Even if the atmosphere were not fully stripped, sufficiently high levels of UV could effectively '“sterilize” the planet. This could wipe out all life with the exception of organisms that live in closed ecosystems deep underground.
How Close Would the Supernova Have to Be?
It would need to be within 160 light years to have perceptible effects on the Earth's atmosphere. However, it would need to be significantly closer to actually create a permanent and total extinction event for all life on Earth.
There may have been a powerful supernova that exploded around 65 light years away from Earth during the late Devonian era. A mass extinction event occurred, but it did not completely eliminate all life on the planet. If this was a supernova, some ozone must have remained in the atmosphere, and this continued to offer some protection against UV radiation.
If such an event were to occur in the present day, it would not be possible for humanity as we know it to survive without significant prior preparations. There could be destruction of around 50% of the ozone layer almost immediately. This would allow in exceedingly high concentrations of the frequencies of UV that currently reach Earth's along with a small amount of higher and more dangerous frequencies.
Exposure to the sun would be rapidly lethal to humans and most other animals. Even in the shade, there would be significant scattering of UV radiation.
The supernova itself would be extraordinarily bright and would be far brighter than even the moon. The event would also trigger extensive auroras. Though, conditions would remain harmful to humans even at night. High levels of nitric oxides from the destruction of the ozone layer may cause respiratory issues for humans and animals.
There would be small amounts of UV still present at night, especially shortly after sunset and before sunrise. However, this would be a minor threat. Cosmic rays would bombard the Earth 24/7, and this would greatly increase levels of ionizing radiation. This would lead to an increase in cancer rates, resulting from exposure. These rays would be present even at night, and the only protection (partial) would be deep underground shelters.
Gamma Ray Bursts Pose a Threat at Greater Distances
If the supernova's concentrated gamma ray burst were aimed directly at Earth, severe effects could occur at far greater distances. Fortunately, this burst is quite narrow, which makes the chances of one hitting the Earth quite low. Though, even if it were located within a few thousand light years of Earth, a direct hit from a gamma ray burst could cause some damage to the ozone layer.
If the gamma ray burst original from a supernova 1,000 light years away, as much as 50% of the ozone layer could be lost. If the gamma ray burst came from a relatively close supernova, it could strip away large amounts of the atmosphere and effectively sterilize the side of the Earth facing the supernova instantly.
Could This Actually Happen?
The good news is that there aren't any stars that could go supernova in the foreseeable future that are located close enough to cause issues here on Earth. Massive stars will become a supernova at the end of their life, and white dwarfs can also explode in this fashion if their mass reaches a critical threshold. Fortunately, the only stars in our vicinity that could go supernova are located at distances that exceed the 160 light years threshold for causing atmospheric effects.