Particles are sucked in by gravity. When the energy is high enough, nuclear fusion takes place. Hydrogen fuses to form helium. It emitts gamma rays at a steady rate. Eventually, enough fusion reactions take place in the core of the protostar so that there is enough pressure to stablize the gravitational contraction, and the nebula becomes a true star.
More hydrogen is consumed in fusion reactions and converted to helium.
Eventually, the gravitational forces cause the core to contract and heat up. The star expands, and its outer surface cools. The star changes rapidly, as its hydrogen and helium stores are rapidly depleteduntil no further fusion energy can be obtained, and the gravitational forces cause the star to collapse. As it shrinks, the star cools as well, becoming a white dwarf. When its light has gone out entirely, a star has become a black dwarf - a dark, cold chunk of ash.