How can heavy elements exist when the universe is young compared to the lifetime of a star? Our sun is said to be incapable of producing heavier elements, and these are thought to originate from older stars dying and going supernova. If our sun is 4-5 billion years old, and has a lifetime of 10 billion years, how could an earlier sun have lived and died in the short time between the creation of the universe and the birth of our fine solar system?
First, stars evolve at radically different rates. The higher the star's mass, the faster it evolves.  The more massive stars had plenty of time to go through multiple generations before the Sun started to coalesce.

It went even faster than it does today, because the collapse of interstellar clouds to form stars is halted mainly by radiation pressure from the new star blowing the rest of its birth cloud away and ending accretion. Since hydrogen and helium are transparent to most of the new star's radiation, the very first stars could grow larger than stars do today. (They were pretty much made of nothing but H and He (with a bit of Li), since very little of the heavy elements had yet formed.) They went through their lifetimes and turned into supernovae and neutron stars very quickly. The largest had lifetimes on the order of just a million years.

So by a very short time after the first stars lit, they were already spewing heavy elements back into space and later stars already had some heavier elements in them at formation.  The fraction of heavy elements has increased steadily since then, but the Sun formed many billions of years after heavy elements became common.