Stars form from clouds of dust and gas called nebulae.
The force of gravity makes the gas and dust spiral in together and the energy is converted into heat energy and so the temperature increases.
When the temp is high enough, hydrogen nuclei undergo thermonuclear fusion to form helium nuclei and give out energy. A star is made.
This long stable period is where the amount of heat…