All stars undergo the process of life; they are born, they live, and they die. About 2 billion years from now, our star will begin the process of dying. When the sun runs out of hydrogen, it will expand into a red giant before condensing into a white dwarf. The lifespan of the sun depends on its size; our sun has a diameter of about 864,000 miles and a lifespan of about 10 billion years. Having been around for 4.5 billion years, the sun is about halfway through its lifespan. However, human beings have at least 1 billion years to continue living on Earth after which the sun will expand outwards and become hot enough to boil the world's oceans.
The sun is currently a “main sequence” star, meaning that it is effectively converting hydrogen into helium. After about 3 billion years, all the hydrogen in the core will have been converted to helium. However, the sun’s core is not dense enough to convert helium into a different element. Since there’s nothing more to burn in the core, the gravitational force weakens, and the sun begins to expand outwards. Its surface will change from white-hot to red-hot and will thereafter be known as a “red giant.”
Death of the Planets
The sun will expand to reach the orbit of Mars, and although the orbit of the Earth will shift further, it will not be enough to save the planet. Earth will be swallowed by the sun and disintegrate rapidly. Life will stop existing billions of years before the Earth disintegrates because soon after exhausting hydrogen in the core the sun will begin expanding and the temperature of the Earth will rise by 10% every billion years. Oceans will evaporate, and the Earth will look like Mars. The habitable zone will shift further away. Mars will become the new Earth. But even Mars will not last long in the habitable zone, a billion years later, it will suffer the same fate as Earth, and the habitable zone will move further towards Neptune and Saturn. By the time the sun stops expanding, the habitable zone would have extended to Pluto and the Kuiper Belt.
Eventually, the hydrogen in the outer layer of the sun will get depleted, and there will be nothing more to provide energy. The sun will begin collapsing. The habitable zone will begin moving inwards, but by then all planets would have disintegrated during the expansion. Helium will fuse into carbon, oxygen, and other heavier elements. At this point, the gravitational force would be too weak to hold the sun together, and the core will separate from the outer layers resulting in a planetary nebula. The sun will eventually die by shrinking to about the size of the Earth and cooling down into a white dwarf star.