A larger star will swell to become a red supergiant, in which helium nuclei fuse to form carbon, followed by further fusion that produces heavier nuclei such as nitrogen and oxygen. It expands, cools and turns red. The outer layers then blast away as a supernova is formed. The core collapses and depending upon mass, it forms either a neutron star or a black hole.