If a supernova were to go off within about 30 light years of us, that would lead to major effects on Earth, possibly mass extinctions. X-rays and more energetic gamma rays from the supernova could destroy the ozone layer that protects us from solar ultraviolet rays. It could also ionise nitrogen and oxygen in the atmosphere, leading to the formation of large amounts of smog-like nitrous oxide in the atmosphere.