Stars are mostly made up of hydrogen and helium, with only trace amounts of heavier elements. A star is a massive incandescent ball of plasma held together by its own gravity. The principle process that occurs within a star is the conversion of hydrogen into helium.
The conversion of hydrogen into helium within the core of a star produces so much energy that the elements themselves exist as a soup of positively charged ions with some or all of their electrons moving about freely. This process of stellar nuclear fusion can continue for billions of years, until all of the hydrogen has fused together to form helium. When the available hydrogen is used up, the star expands to form a red giant and begins fusing helium atoms into carbon atoms. In more massive stars, heavier elements are made by fusing together smaller elements, which are released into space as the star dies. During a supernova, the heaviest elements, such as uranium and gold, are made and flung out into space when the star explodes.