Sunspots are created when:

fusion reactions stop happening to particles on the surface of the Sun

the Sun burns out and starts to die

the Sun releases massive amount of plasma into the atmosphere, creating dark spots

tangled magnetic field lines prevent cooled plasma from sinking back into the Sun

tangled magnetic field lines prevent cooled plasma from sinking back into the Sun