All atoms, besides Hydrogen an some of the Helium were formed in stars. After the Big Bang, all that existed was lots of energy in various forms, Hydrogen and Helium (probably some plasma and maybe trace amount of a few heavier elements). These gases coalesced into super stars that burned very hot and quickly. The gravitational forces from the star formed most of the atoms up to and including iron and a few beyond. All Carbon, Oxygen, Nitrogen, Copper, and more formed this way (and continue to form in stars today). Then the stars Super Novaed and in the process formed some of the heavier metals and flung this material into space. This happened billions of times. This matter was pulled into other stars and some of it formed orbits. The matter attracted together more matter and eventually planets were formed. Life evolved, tools were used, computers were invented and then I typed this.
For our day to day lives, this is rather useless information but I still think it is interesting.
NoOne1