How do stars like the Sun produce energy? The answer was established many decades ago by a “gardener” by the name of Cecilia Payne-Gaposchkin. While formally she really was on the grounds staff at Harvard College Observatory, actually she was a quantum physicist with a strong interest in astrophysics.
At the time it was known that different stars show evidence for different atomic elements emanating from their surfaces (to the extent that a ball of gas has a surface). These elements included a whole zoo of different types from hydrogen and helium to carbon, magnesium, calcium, titanium and nearly every element in between. This led many people to believe that each star was made up primarily of a different element.
A star that showed a lot of iron coming from its surface was thought to be made out of iron, and meanwhile a star that showed a lot of calcium was made up mostly of calcium, and so on. This idea was not a good one though, because it did not explain how a star is able to have a long life.
Under this scenario which we now know is not correct, a star would have produce energy by slowly contracting over time. This does happen to stars, and does produce energy, but in the case of the Sun it can only produce energy for about 10 million years.
Geologists were already telling us many decades ago that Earth had to be much older than 10 million years, and the Earth has to be a bit younger than the Sun, so some major piece of how the Sun works was missing.
As a result of Payne-Gaposchkin’s work, we now know that the Sun, and in fact ALL stars are made mostly of hydrogen and only hydrogen. The diversity of elements coming from their surfaces is really only coming from trace amounts of various metals. So now, if the Sun, and the 300 billion stars in our Galaxy are all made of hydrogen, and so are all the stars in the other 300 billion galaxies, it tells us that hydrogen must be the primary building block of all structures in the universe everywhere. Thanks to Payne-Gaposchkin, who eventually became head of the Harvard College Observatory Astronomy Department, we were able to learn something significant about the whole universe.