If the star has smaller mass than the Sun, it can fuse hydrogen into helium for at least a trillion years. The larger a star, the shorter its life because it fuses hydrogen into helium much more quickly. A star whose mass is more than 20 Suns will run out of hydrogen in only a few hundred million years.
i think that's kinda what you are asking i hope i helped if not then i'm so sorry i hope you have a blessed day!!