The main sequence is the longest and most stable period in a star's life. A star enters the main sequence once hydrogen fusion begins in its core, providing a stable source of energy that counteracts gravitational collapse. During this phase, a star fuses hydrogen into helium, producing light and heat. The position of a star on the main sequence is primarily determined by its mass.