What happens next depends on a star's mass. For example, for massive stars (greater than 8 solar masses), this collapse is so violent that it causes a huge, catastrophic explosion. It is in these explosions that all elements heavier than iron are produced. The temperatures and pressures become so high that the carbon in the star's core begins to fuse. This halts the core's collapse, at least temporarily, and this process continues, over and over, with progressively heavier atomic nuclei.
The cores of those supernovae begin to resemble an onion, with layers upon layers of elements - the outermost layer is hydrogen, which surrounds a layer of hydrogen fusing into helium, surrounding a layer of helium fusing into carbon, and so on. In fact, most of the heavy elements in the periodic table were born in the intense furnaces of exploding supernovae that were once massive stars.