How are the Sun’s magnetic field and its activity cycle related?
Through sunspots that are centers of high magnetic field, that have 11 year cycles.
In the Sun, the flows of hot plasma in the convection zone create the solar magnetic field. This is sustained by nuclear fusion in the Sun. Sunspots are regions of very strong magnetic field that are perceptible on the Sun's surface or photo-sphere. The number of sunspots on the sun increase and decrease over time in a regular, approximately 11-year cycle, which is, in fact the solar magnetic activity cycle.