Following the Big Bang there were initially only 3 elements; mostly hydrogen, a little helium, and a tiny amount of lithium. Every atom more complex had to be formed inside of a star, and beyond iron a violent supernova explosion is required. This is because up until iron energy can results from nuclear fusion, but from that point fission is necessary.
Even more complex elements can only be borne from the collision of two neutron stars. In a recent observation of such a collision we saw the creation of 10,000x the mass of Earth in gold.