To maintain a star’s internal thermal pressure, two processes are involved: nuclear fusion and gravitational contraction.
Nuclear fusion within the star implies that the nucleus of hydrogen atoms combines to form the nucleus of one or more larger ones. When this happens, helium atoms are formed, and a high amount of energy is released, together with neutrinos with high energy.
As this energy is being dispensed, gravitational contraction begins. The weight of the centrally located luminous celestial body begins to pull in the helium gases.
These two forces help the star maintain its energy, internal thermal pressure, and diameter.