What makes the stars burn?
Stars, such as our Sun, don't really burn at all. They achieve a lot of their energy output by nuclear reactions, fusing, by a number of steps, four hydrogen nuclei into a single helium nucleus. (This, in spite of what the textbooks say, is not the same reaction as hydrogen bombs.) Helium itself, when there is enough of it, can react to become a carbon nucleus by a peculiar triple reaction. Once there are a few carbons, it is relatively easy to fuse nitrogen and oxygen. In really big stars, carbon and oxygen can fuse to form aluminum, silicon and other heavier elements.
How can we know this?
Indirectly. Because we see a lot of old burnt-out stars (called white dwarfs) that are rich in carbon and helium atoms at their surfaces, we know that helium and carbon are being made. We also know that what mostly goes into a star is hydrogen. Therefore, young, healthy stars probably fuse hydrogen.
When the sun runs out of fuel, will it turn into a white dwarf?
Yes, after passing through various stages, one of which is the red giant. But the hydrogen fuel in our sun is enough to last billions of years yet.
Will it explode?
It will seem like an explosion, but it will be nowhere near as powerful an explosion as a supernova or even a nova. It will puff off its thin outside layers to reveal a burnt-out cinder core.
What are supernovas and novas.
Novas are binary star systems with a too-close regular star pouring gas onto a white dwarf companion. Fresh fuel builds up until it initiates fusion, but the white dwarf core doesn't allow normal burning to proceed. It goes off explosively, and over a few days the star becomes 10,000 to 100,000 times as bright as the sun, but it doesn't last long. Then the process starts again.
Supernovas are another thing entirely. Very large stars can fuse things like silicon and aluminum together to get elements around iron. But iron cannot be fused to extract energy. An iron core builds up and eventually the fusion of the elements around mass 25 or 30 becomes unstable, blowing the star apart. This would be bad enough but as the shock wave passes through the star, it causes other slower-going reactions to ignite explosively too. It is estimated that the entire oxygen-fusing layer goes off in seconds. The amount of energy liberated is unimaginable. For a few days this one star shines with a significant percentage of the brightness of its 100-billion sun galaxy. But this requires a really big star.
There is another type of supernova that occurs in some regular nova systems. If the mass of the white dwarf increases after repeated novas to somewhere around 1.4 solar masses, the white dwarf explodes. This is a Type 1 supernova and it is even brighter than the big-star supernova.
If a supernova went off nearby, could it harm people?
Yes, the radiation of a supernova within 200 light years might be intense, but there are no candidates for supernovas out to beyond the distance it could harm us.
How do they know what is in stars?
By spectroscopy. About 150 years ago people found that a cooler gas between us and a uniform light source subtracted energy in very narrow color regions. By carefully measuring the colors subtracted you can know what makes up the gas. The gas helium was discovered in a solar spectrum before it was found on the earth, because no one knew what its set of subtracted colors were. It was named after the ancient Greek name for the sun -- Helios.
But what if the substance is solid or liquid, like mercury or iron?
Close to the sun, nothing is liquid or solid. It's that hot.