Job Recruitment Website - Ranking of immigration countries - How can the sun become a red giant and the earth not be swallowed up?

How can the sun become a red giant and the earth not be swallowed up?

There are two possible situations.

First, after the sun becomes a red giant, its gravity on the earth becomes smaller, and the earth's orbit naturally expands outward, reaching a new livable zone without being swallowed up.

Second, after the sun becomes a red giant, the earth still runs along its original orbit. At this time, if humans still exist, it is estimated that they have emigrated to other planets. If the earth must not be swallowed up, then we can use the super booster technology to push the whole earth (which requires a lot of energy), or absorb the energy of the sun so that the volume will not engulf the earth (which may produce by-products).