Answer:
The Sun is a star that experiences changes in its activity in a cycle of about 11 years, known as the solar cycle. During that time, the amount of sunspots on its surface may vary.
But first it is necessary to define what a sunspot is.
A sunspot is a region of the Sun that has a lower temperature than its surroundings, and with an intense magnetic activity. It consists of a dark central region, called "umbra", surrounded by a lighter region"penumbra".
Now, a solar protuberance or prominence is a large gaseous structure located on the surface of the Sun, often in a loop shape, which emerges from the surface of the Sun, the photosphere, and extends to reach the solar Corona. It is caused by disturbances in the Sun's magnetic field (hence it is related to sunspots) and, although most of the gas expelled returns to the surface, sometimes this can release particles that can reach the Earth.
In this context, a solar flare is a sudden, rapid and intense variation of brightness that is observed on the surface of the Sun due to an explosion of hot gases. It releases a large amount of energy in the form of electromagnetic radiation, energetic particles and mass in motion. These phenomena take place in active regions of the Sun, areas of strong magnetic field, and especially in sunspots with great magnetic complexity.
These eruptions are also known as Coronal Mass Ejections (CME), since they occur in the Sun's Corona layer; and can produce X-rays and gamma rays. However, they are classified according to the peak of X-ray flow by the letters A, B, C, M or X, where each letter (or class) represents an increase in energy production 10 times greater than the previous one.
In summary:
When a sunspot is observed it is because in that region there was a coronal mass ejection, also known as a solar flare. This in turn is related to solar prominences.