I would like to start by saying that I am not a physicist and I don't really know a lot about the subject!
We all know that without Earth's magnetic field, electromagnetic radiation from the sun would cook us within minutes. It is only the magnetic field that protects us from them. Since visible light is the same thing as cosmic rays, except that it's a different wavelength, I was wondering if it were possible to use magnetic fields (they would have to be pretty strong) to essentially "block" light the same way it blocks cosmic rays?