As a protostar becomes denser, it gets hotter, and the nuclei of hydrogen atoms and other light elements start to fuse together. Energy is released and the core gets hotter and brighter. This can continue for billions of years until the star runs out of hydrogen nuclei to fuse together. The inward force of gravity is balanced by the outward radiation pressure so the star is stable. During this period the star is called a ‘main sequence star’. Eventually the star will run out hydrogen nuclei and will swell into a ‘red giant’. Then, if the star is small, it will contract to form a white dwarf and then a black dwarf. If the star is much larger, it will continue to collapse and explode in a supernova. The dense core that is left is a ‘neutron star’, which is a ‘black hole’ if it is massive enough.
OKAY that’s the last physics I’m ever gonna throw at you. Ever. ^^