Low mass stars spend billions of years fusing hydrogen to helium in their cores via the proton-proton chain. They usually have a convection zone, and the activity of the convection zone determines if the star has activity similar to the sunspot cycle on our Sun. Some small stars have very deep convection zones. Some of these stars also rotate very quickly which twists their magnetics fields. When these field lines line up, the result can be a flare of radiation including X rays.
Over its lifetime, a low mass star consumes its core hydrogen and converts it into helium. The core shrinks and heats up gradually and the star gradually becomes more luminous. Eventually nuclear fusion exhausts all the hydrogen in the star's core.
A star's lifetime is proportional to its mass divided by its luminosity
t ∝ M/L
A star's luminosity is roughly proportional to the 3.5 power of its mass so
L ∝ M3.5
t ∝ 1/M2.5
where t is the Sun's main sequence lifetime, a star with a mass 4 times the Sun's would have a lifetime of 1/42.5 or 1/32 solar lifetimes.
When hydrogen fusion can no longer happen in the core, gravity begins to collapse the core again. The star's outer layers expand while the core is shrinking and as the expansion continues, the luminosity begins to increase. For a star with the mass of the sun, this expansion takes about a billion years and the star's radius increases 100 times, and its luminosity increases even more. The star is called a red giant. A hydrogen burning shell forms around the helium core, and the shell contributes more and more helium to the core over time.
Eventually the core becomes hotter and denser and reaches a temperature of 100 million K, and helium nuclei begin to fuse into carbon. The helium fusion then heats the core rapidly even more and a helium flash takes place. This causes the core to expand, which lowers the temperature of the core and reduces the total energy output from what it was during the red giant phase. The outer layers then contract and the star's temperature increases a bit.
After about 100 million years, the star fuses all its core helium into carbon. Then a helium fusion shell forms around this core, and the hydrogen fusion shell remains around that. It then becomes a red giant again and remains like this for a few million years with its outer layers continuing to expand.
Eventually gravity can no longer contain the outer layers of the red giant and the star ejects these layers into space. The remaining carbon core is still very hot and emits ultraviolet radiation that ionizes the gas in the expanding shell and makes it glow brightly. This glowing gas is called a planetary nebula, but has nothing to do with planets. Planetary nebulae are relatively common and astronomers estimate that there are between 20,000 and 50,000 in our galaxy. Planetary nebulae often have elongated shapes. One theory is that the star first ejects a doughnut shaped cloud of gas and dust from its equator, then ejects gas from the entire surface. The doughnut blocks some of this ejection and it is channeled in two opposite directions. As the core cools, the glowing gas fades and disperses and the nebula disappears within a million years or so.
The cooling carbon core is all that is left. At first its surface temperature is around 100,000 K and emits ultraviolet radiation which ionizes the gas in the nebula and makes it glow. The cooling core is called a white dwarf, and eventually can no longer be seen and is then called a black dwarf. The matter in a white dwarf is very dense about 109 kg/m3, which is a million times denser than water. A teaspoonful of white dwarf matter if brought to Earth would weigh about 5 tons!