Well the heaviest a star can get is Iron.
But then when it went Supernovae, SOME of the elements were created from the pressure waves. But not all of them.
Some of the other elements were created when it struck a massive molecular gas cloud.
At least that’s what I remember. After that, static electricity started collecting things together. When they were big enough, gravity took over, and stuff was spinning… spinning, spinning.. and the rest is the animations we saw in grade school I think.