The main stages in the life of a star of the size of the sun are:
1. Formation of protostar due to the condensation of the gases present in the galaxy.
2. On further contraction, the temperature and pressure inside gradually increase to about 10 million degrees. At this stage, fusion of hydrogen into helium occurs and a large amount of energy is released. This raises the temperature of the protostar further. The protostar now begins to glow and becomes a star.
3. When the fusion reaction in the core stops, it starts contracting. The fusion in the outer shell, however, continues. This causes expansion of the shell and at this stage the color of the star becomes red. This is called red-giant phase.
4. The star in the red-giant phase would lose its shell and the core would condense into an extremely dense hot ball of matter. High temperature in the core then causes fusion of helium into higher elements and core starts glowing as white dwarf star.