Dust and gas cloud present in a galaxy, interstellar matter clumps together to form nebulae where stars are formed. Gravitational attraction draws particles together, cloud becomes more concentrated, temperature and pressure increase, fusion occurs creating a star which stays stable for billions of years. Eventually, the star runs out of gas to fuse, leading to collapse. If massive, it produces a supernova and forms a neutron star or black hole. If normal-sized, it swells to produce a red giant star, then contracts and cools into a white dwarf