Main-sequence stars fuse hydrogen atoms to form helium atoms in their cores. This hyperlinked image a simplistic explanation to the life cycle of a low-mass main-sequence star.
A main-sequence star begins as a mass of gas dust called a nebula. Gravity pulls in the matter and causes it to collapse. The collapsing increases temperature and density within the nebula and it begins to spin. This is how a protostar is formed. As the protostar continues to collapse, it continues to increase in temperature. This causes nuclear fusion and the star is formed. Hydrogen is converted into helium in the core of a low-mass main-sequence star. Once the hydrogen is consumed, the core begins to shrink and the star begins to expand (because it is no longer at gravitational equilibrium). As this occurs, the star begins to cool. Hence, a red giant is formed (the color red indicates a cooler temperature than a white star). At this point, the star uses helium as fuel and converts it into carbon. This is referred to the helium burning stage. Once the carbon fuel is used, the star blows up into a planetary nebula. Once the outer layers have been ejected, the core is left. This is what is seen as the white dwarf.