This is how sun will eventually swallow Earth

Stars such as our Sun burn hydrogen in their cores for most of their lives. Once they run out of this fuel, they puff up into red giants, becoming hundreds of times larger and engulfing nearby planets. As shown in this animation, in the case of the Solar System this will include Mercury, Venus, and even Earth, which will all be consumed by the red-giant Sun in about 5 billion years. Eventually, Sun-like stars lose their outer layers, leaving behind only a burnt-out core, a white dwarf.