For most of its life, a star shines due to thermonuclear fusion in its core releasing energy that traverses the star’s interior which then radiates outward.
Stars are mostly made up of hydrogen atoms.
At 10 million°K (about 18 million°F or 10 million°C), the nuclei of hydrogen atoms fuse, or join together and change into helium.
It takes four hydrogen atoms to change into one atom of helium.
This process of converting hydrogen into helium is commonly known as nuclear fusion.
Some of the star’s mass is lost as it is converted into energy, but the energy continuously created through thermonuclear fusion is what feeds the star throughout its maturity.