How do sunspots affect global warming?
One has nothing to do with the other. Sun spots are a constant; they are always there. The only variation in them is their number and size.
Global warming is entirely due to the amount of carbon dioxide mainly, but certain other pollutants as well. Carbon dioxide and the other pollutants, ie the amount of dust in the air, work like a blanket above the earth holding in heat rather than allowing it to radiate back into space. Sun spots do not factor in to this process.