Stellar evolution describes the life cycle of a star, detailing its life stages from formation to eventual demise. Stars originate from vast molecular clouds of gas and dust, collapsing under their own gravity to form protostars. Once stable, the star enters the main sequence phase, maintaining equilibrium through the energy generated by nuclear fusion, primarily converting hydrogen into helium. The subsequent path of the star depends critically on its initial mass. Stars of lower mass will eventually exhaust their core fuel, leading to the shedding of outer layers and the formation of a planetary nebula around a white dwarf core. Conversely, massive stars undergo much more energetic transformations, potentially collapsing violently in a supernova explosion, which leaves behind ultra-dense remnants such as neutron stars or black holes.