Recall that all atoms are made of a very dense and small nucleus which is positively charged and a bunch of electrons, which are negatively charged, and which surround the nucleus. At the center of the stars temperatures as very high (at least a few million degrees Celsius); pressures are also high Under these circumstances the electrons are stripped off the nuclei and float around. In this large-temperature environment both electrons and nuclei very high speeds, so high that when two nuclei collide they often overcome the the repulsion produced by the fact that they both have positive charge. But when the nuclei come in such close contact with each other they will ``stick''. The result is a new nucleus and also energy is released. For example one can imagine slamming Hydrogen nuclei to produce the nucleus of a new element, Helium (see Fig. 9.3).
The result of the nuclear reaction in Fig. 9.3 is the depletion of Hydrogen in the star, the creation of Helium, and the release of energy in the form of radiation. Some of the radiation will heat the environment encouraging more nuclear reactions of the same type, but a small fraction of this energy will make its way to the star's surface and escape into space. Knowing the equivalence of mass and energy this implies that the stars become slightly lighter through this process. For our sun the loss is of ``only'' 1.35 × 1014 (135 trillion) tons per year (which is only about 7 × 10-12 - 7 trillionths - of a percent of the total solar mass). The jargon is that this reaction ``burns'' Hydrogen and that resulting ``ashes'' are mainly Helium.
The above is just one of a very large number of fusion reactions but it is the most common, and is present in all stars at some stage of their lifes. Other reactions are also important, I will talk about them later.
As time goes on the amount of Hydrogen drops and, eventually, there is not enough left to generate appreciable amounts of energy. There are nuclear reactions involving Helium (which is now quite abundant), but they require higher temperatures. So, when the Hydrogen is used up, the nuclear reactions turn off and the star continues to contract due to the gravitational pull. But, just as before, as the contraction proceeds, the temperature at the core raises, eventually reaching the threshold of nuclear reactions involving Helium.