How long a star “lives”, with fusion powering it’s core depends on how massive it is. A star like the Sun will “live” about 10 billion years. The Sun is currently about 5 billion years old. Bigger stars burn brighter, but burn-out faster
The Death of Stars Red Dwarf: The smallest, dimmest stars, less than.4 solar masses. Longest lasting stars. Most stars are red dwarves. They use fusion to slowly combine hydrogen into helium. They would take about 2 billion years to contract to the main sequence and 6 trillion years to use up all its hydrogen, after which fusion would shut down, and the star would grow cold and dark.
Sunlike stars: With a mass between.4 and 4 solar masses, use fusion to combine hydrogen into helium.When they run out of hydrogen (6 trillion to 310 million years), the outer layers of the star expand into a “red giant” while the core contracts and starts to fuse helium into carbon and oxygen. The core cannot get hot enough to fuse carbon and oxygen, so when the helium runs out, fusion stops. The outer layers of the star are blown off, and you are left with a “white dwarf” which slowly cools off and grows dim, becoming a brown dwarf.
“Big” stars over 4 solar masses can use fusion to create energy up to iron. After iron, fusion reactions don’t produce energy. With no energy pushing outward from the core, gravity causes the star to quickly collapse and then explode in a supernova. Big stars may live as short as 7 million years up to 310 million.
“Big” stars (between 4 and 15 solar masses) that supernova produce a neutron star. All that mass would be squished down to a tiny size from the enormous gravity, becoming very dense. 1 cm 3 of it would weigh 10 million tons. Spinning neutron stars are called pulsars. X-ray source
Neutron stars are about 12 miles wide and when they spin extremely fast they can develop strong magnetic fields and are called Magnetars. The magnetism occasionally rips the solid crust of a Magnetar apart, releasing more energy in.2 seconds than the Sun puts out in 250,000 years. The magnetism would kill you within 600 miles by reshaping the atoms in your body.
“Huge” stars with more than 15 solar masses last less than 7 million years and contract with so much gravitational acceleration, that no physical force in the Universe can stop the collapse. These stars become “black holes”. Nothing that comes near it can escape its gravity, not even light.