As a cloud of elements necessary for star formation collapses, particles are in free fall. Heat generated by particle collisions travels via radiation. Temperature and pressure are low at this point. At some later time the core will become dense enough to trap radiation and as a result it will start heating up. Pressure also starts to build up and the core degradation begins to slow down. At this stage stars are designated pre-main sequence (PMS) stars, and it takes ~106 years to get to this point.
Temperature is low but the radius is large, hence luminosity is high. Low temperature causes high opacity (ie less visible light) so as a result there are less electromagnetic waves to transfer heat and therefore heat occurs by convection (movement of continuous stream of heat) rather than by radiation. Convection causes good mixing which results in even temperature throughout the star and hence the surface luminosity will be higher than for a normal star (because the innards of a normal star are hotter than surface). Temperature and luminosity rise as matter builds up onto the surface while the gravitational contraction continues at a slow pace.
After ~104 years the star reaches a stable period where luminosity is constant as temperature is balanced by gravitational contraction. However, in comparison to a normal star, this luminosity is much higher. As temperature increases, opacity decreases until radiation begins to dominate over convection in the core. Thermal transport is not as efficient so as the star contracts, core temperature increases while the surface begins to cool. As temperature and radius decrease, so does luminosity. When radiation becomes dominant, temperature starts to rise rapidly. Once it is sufficiently high, fusion commences. When the main source of energy for a star is its fusion process (rather than gravitational) it is called zero-age main sequence star (ZAMS). Time from initial collapse to ZAMS is ~20 million years and time on main sequence is ~1010 years.
During the H burning phase, temperature and radius will slightly increase. Fusion ends when H in core is used up but it continues in a shell around the core. Core contracts as there is no energy generation which produces higher temperature and more energy. Radius decreases as does the temperature on the surface and with it luminosity. Opacity increases which causes convection leading to good mixing and dramatic increase in radius and luminosity. The star becomes a red giant RGB.
RGB has a dense core, is several times
Earth's radii, T
506K and is surrounded
by a vastly expanded low-density shell. The core is a degenerate electron gas. Because
of the lower quality of electron gas, temperature caused by fusion does not increase
the pressure and there is no expansion. The core continues to collapse until fusion
commences. The resulting energy causes runaway He fusion throughout the entire core
called Helium flash. Temperature increases dramatically and at about 350 million
K, electrons become non degenerate. The core expands and cools bringing down the
temperature and luminosity with it. This is followed by a stable period when He
is burning in the core and H is burning in a layer outside the core. When He is
converted to Carbon, fusion continues in the outside layer. A second red giant phase
commences and it is called Asymptotic Giant Branch.
Eventually Thermal Pulses can occur
because the triple alpha process (4He + 4He <-> 8Be,
8Be + 4He <-> 12C +
+ energy) is a temperature dependent process.
These pulses occur every 1 000 years or so and affect the temperature, radius and
luminosity. One of the side effects of these pulses are super winds (a strong outflow
of matter) which cause the outer layer of star to be shed in approximately 103
years leaving behind a hot core. The expelled matter forms an expanded shell called
planetary nebula. The core which is now made up of carbon never reaches the sufficient
temperature for carbon fusion. With only gravitational energy, the star will slowly
collapse and in 105 years it will become a white dwarf before it further
cools and turns into a black dwarf (~109 years).