Eventually, the star explodes and collapses. When a very large star explodes, it becomes a supernova. Supernovas spread their material through space. In the Big Bang, only the simplest atoms, hydrogen and helium, were formed, but supernovas spread more complex atoms outward. Our sun, formed from a cloud with these more complex atoms.
Stars come in all sizes.
They are mostly hydrogen. Tiny particles of this hydrogen smash together into larger particles that make up helium, the next biggest element. This collision releases energy that keeps the stars shining. This collision releases energy that keeps the stars shining. The energy also keeps them from collapsing under their own gravitational pull.