The Sun will become a red giant in about 5 billion years and consume the Earth. But the Earth will already be toast by then.
One of the reasons for humans to develop intergalactic travel before that day arrives is to find and be able to move to an Earth-sized planet suitably orbiting a star that has a similar size and age to our Sun today, and is in a nice neighborhood, away from black holes and soon-to-become supernovas.
Oh, and it’s likely the people moving to the new planet will need to have Galactic Van Lines ship along the oxygen from the Earth to unload in the new planet’s atmosphere. That is unless the planet already has photosynthetic lifeforms that have converted CO2 to O2. Depositing some of Earth’s photosynthetic organisms in the oceans of the new planet ahead of time might take a couple billion years or more to produce the needed oxygen.
Dealing with any current tenants of the planet is a separate issue.
According to the Scientology cult, that’s how we got HERE in the first place!.................