A star's life cycle is determined by its mass--the larger its mass, the shorter its life. High-mass stars usually have five stages in their life cycles.
A star consists of two gases--hydrogen and helium. During the first life-cycle phase of a high-mass star, the hydrogen in the core burns until only helium is left.
When the hydrogen supply in the core runs out, the core becomes unstable and contracts. The lack of hydrogen causes the helium to fuse into carbon. When the helium is gone, the fused carbon forms heavier elements in the core such as iron, magnesium, neon and sulfur. The core will turn into iron and it will stop burning. Then the outer shell of the star, which is mostly hydrogen, begins to expand.
Over the next million years or so, a series of nuclear reactions occur, forming different elements in shells around the iron core.
The core will then collapse in less than a second, causing an explosion called a supernova. The explosion will cause a shock wave that will explode the outer layers.
If the core survives the supernova, it can either become a neutron star or a black hole. That depends on how many solar masses the core is. A solar mass is the standard way to describe mass in astronomy (One solar mass is equal to the mass of the Sun, or about 1.98892 ×10^30 kg). If it's between 1.5 and 3 solar masses, it will become a tiny, very dense neutron star. If it's greater than 3, then the core will contract to become a black hole.