Life Cycle of a Star
Before the Star
Before a star is born, space is filled with gas and dust. This dust is called interstellar medium. It is what makes up all of space where there isn't planets or stars or other such astronomical bodies. Most of the dust and gas is made of hydrogen but about 10% is helium. In some places where there are magnetic fields or high gravity this interstellar medium can come together to create nebulae.
Prostars and Equilibrium
Nebulae create prostars, which are basically stars that have not yet started to fuse hydrogen into helium. When the hydrogen does start to fuse it has officially become an actual star. A prostar gathers itself in a nebula and slowly creates it's own gravity. The process of the star pulling itself together is called accretion. When the gravity is strong enough the star will start to fuse hydrogen. At the point when the gas pressure is pushing outwards and the gravity is pulling inwards, the star has reached equilibrium. The two forces must be balanced. It is now as stable as it will ever get.
A Real Star
After equilibrium has been established, nuclear fusion begins. In nuclear fusion atoms are fused together to create new elements. As this happens the gravity is slowly contracting the star so it becomes smaller little by little. This continues throughout the stars life.
Main Sequence
Main sequence stars burn hydrogen into helium. Stars are constantly burning their fuel but at the same time they are working keep together. The gravity is pushing the star together but at the same time the gas and radiation pressure are trying to pull it apart from the inside. The process of the star struggling to hold together is called hydrostatic equilibrium. If the two forces are not balanced exactly then the star will either collapse in on itself or expand. Once a star fuses all of the hydrogen into helium it is no longer a main sequence star.
Red Giant
Large stars normally turn into red giants. A red giant is normally made up of helium because most or all of the hydrogen has already been burned. In this phase the helium starts to burn into carbon. It has a greater mass now as a red giant. The star has started to expand and has grown much hotter as it tries to burn the helium. Stars do not live long as red giants because they are much less stable than main sequence stars.
The Death of a Star
A star dies when it can no longer maintain equilibrium and thus stops nuclear fusion. Equilibrium ends when either the star's gravity is too weak and the gas pressure forces the star apart or the gravity pulls the entire star in on itself. Low mass stars turn into white dwarfs. White dwarfs contract in on themselves until they no longer can. Finally the outer layers drift apart and become a planetary nebula where new stars can be formed.
Medium mass stars turn into neutron stars. Neutron stars are extremely dense and have insanely strong magnetic fields. Eventually the pressure becomes too much and the star bursts into one last explosion and burns all of it's last fuel. This is called a supernova. The carbon that was left over in the neutron star has now been fused into iron.
The largest of stars go through the same type o thing as a medium sized star except that it does so very quickly and suddenly the gravity is pulling it back together again. Nothing is holding it together anymore so the whole thing literally rips a hole in space and creates a black hole.