How do nebulae affect earth?
It does not affect.
The closest nebula is the Orion Nebula at more than 1300 light years from Earth. It is so remote that nothing that happens there can influence the Earth.
The only influence is to have beautiful colors and shapes and to let us dream one day to go there and explore them.