Supernovae come in several varieties. There are two main types recognised by modern astronomers.
The first are called core-collapse supernovae. They occur when a star at least 8 times the mass of our own star, the Sun, comes to the end of its life. At that point, the core of this massive star is made largely of iron. The star can no longer fuse elements to make energy which means that the outward pressure of the star drops. The force of gravity trying to pull everything into the middle of the star then wins and starts a rapid collapse. Huge amounts of energy are created during the collapse and new elements form in the process. The outer layers of the star collapse until they reach the iron core. When they reach the core it is so dense that they bounce off the surface at around 30,000 km/s sending shock waves through the star. These shock waves cause the star to explode. The star brightens quickly, then gradually fades away leaving only core. During the explosion the core collapses down to form either a neutron star or a black hole.
The material which was ejected from the star surrounds the core in what we call a supernova remnant. It will eventually drift into space and find it’s way into a new gas cloud. This cloud will go on to produce more stars in a big cosmic recycling process. This is how the elements made in the first stars became part of our Sun, our Earth and indeed us! (Note that astronomers have split the class down further into around 7 subgroups).
The other type of supernovae are called thermonuclear explosions. These occur in systems containing two stars, known as an "interacting binary". The two stars are close enough that the outer layers of one star are pulled on to the other through gravity. If the star which is gaining mass is a White Dwarf, enough material can be piled onto it to cause a nuclear explosion on the surface. This explosion destroys the star, tearing it apart. We see the star getting very bright and then fading over a few weeks.