I will describe various aspects of stellar activity that control the environment of exoplanets, produce photochemical reactions in their atmospheres, and drive mass loss. The fundamental drivers of stellar active phenomena are strong magnetic fields for which field strengths can be measured by Zeeman broadening of absorption lines in stellar spectra, and the large scale magnetic geometry and properties that can be measured with Zeeman Doppler imaging techniques. Magnetic heating processes produce warm chromospheres and hot coronae. Chromospheric emission, including the strong ultraviolet radiation of the hydrogen Lyman-alpha line, photodissociates water, carbon
dioxide, and methane molecules in exoplanet atmospheres to produce oxygen that can be false-positive evidence for the presence of life forms. Coronal X-ray and extreme-ultraviolet emission from stellar coronae can heat and ionize the outer layers of an exoplanet's atmosphere, leading to partial or complete evaporation. Magnetic stellar winds can also erode an exoplanet's atmosphere. I will summarize what we know about these diverse phenomena for different
types of stars, in particular for M dwarf stars such as Proxima Centauri and TRAPPIST-1, which harbor rocky planets in their habitable zones.