Fusion reactions in red supergiants and supernovae create heavy elements.
Explanation;
A Red supergiant is a star that has expended its hydrogen fuel, expanded in size, and begun fusing helium or heavier elements in its core, while a supernovae is a red supergiant that collapses and explodes after it has expended its fuel for nuclear fusion reactions.
After burning most of its hydrogen fuel, a main sequence star begins to collapse, heats up, and then begins fusing helium and heaver elements. The star expands in overall size, becoming a red giant or supergiant.
The fusion reactions in red supergiants and supernova explosions create atoms of elements heavier than oxygen.