Quick answer: Stars shine because they are hot.
Stars shine because their surface temperatures are very hot. The temperatures of stars are so high that they defy human comprehension. The Sun has a surface temperature of about 5,700°C. Many stars visible to the unaided eye in the night sky are known to have surface temperatures which range from around 3,000°C to 40,000°C. The lowest temperature stars appear red in color whereas and the highest temperature stars are bright blue.
The incredible temperatures of stars are much hotter than what is generated in household ovens, stove tops, or wood fires. Even volcanic lava is not as hot as the surfaces of stars. However, temperatures of 20,000 to 30,000°C can occur naturally within lightening strikes. Man can artificially generate star-like temperatures in specially engineered and relatively small environments. Examples of those environments are halogen arc lamps, camera flash bulbs, arc-welders, or plasma science apparatus. A tungsten filament used in household light bulbs can reach temperatures just over 3000°C.
The surface of stars visible to observers is called the photosphere. The photosphere is a spherical shell where light can escape away from the star. Just beneath the photosphere a star is opaque. Astronomers can estimate a star’s temperature by measuring the amount of light at different colors in the spectrum of starlight. The spectral signature obeys certain physical laws which relate the temperature of the photosphere.
The process of nuclear fusion is the energy source that keeps stars shining. Deep within the core of a star, temperatures can reach millions of degrees. The initial source of heat is the crushing weight of the star’s great quantity of hydrogen compressed by the force of gravity. When core temperatures reach about 10 million degrees, hydrogen fusion occurs spontaneously.
The great energy released in the core is exchanged with the intermediate layers within the star. Eventually the energy reaches the photosphere where it can be released as starlight. Those photons which fly away from the star begin a journey traveling the vast distances of interstellar space.
Some of the photons released from distant stars reach our man-made telescopes on Earth today. The journey of these photons is ended when they are captured by the retinas of human eyes or by the detectors in astronomical cameras. Some of these photons are known to have traveled for billions of years through space.