A protostar is an early stage in the formation of a star, occurring when a dense region within a molecular cloud collapses under gravity, leading to the accumulation of gas and dust. As the material gathers, it heats up, forming a hot core surrounded by a rotating disk of gas and dust. This process can last from hundreds of thousands to millions of years, during which the protostar continues to gather mass and increase in temperature. Eventually, when the core reaches sufficient temperature and pressure, nuclear fusion begins, marking the transition to a main sequence star.