Nebulae are made of dust and gases—mostly hydrogen and helium. ... Eventually, the clump of dust and gas gets so big that it collapses from its own gravity. The collapse causes the material at the center of the cloud to heat up-and this hot core is the beginning of a star.
Hope this helps !