Answer:
The mass of a star determines its life cycle, that is, more the mass, shorter will be its life cycle. The mass of the star is determined by the concentration of matter, which is found within its nebula. In the nebula, with time, the hydrogen gas comes in close proximity with each other due to gravity and starts to spin.
With the brisk spinning, the gas heats up and turns into a protostar. The temperature now reaches 15,000,000 degrees and within the core of the cloud, the phenomenon of nuclear fusion takes place. The cloud now contracts a little, starts to glow brightly, and turns stable. The cloud now becomes a prime sequence star, and will stay in this phase for millions of years, the Sun of our galaxy is in this stage at the moment.