Don’t worry about this for several reasons.
- The expansion of the universe will not cause the earth to drift from the sun.
- In only about 1.5 billion years our sun will be so hot that all life on Earth will cease.
- After another 4 or 5 billion years the sun will become a red giant, swallowing Earth and everything on it.
- All this happens before you have to worry about expanding the universe.
Food for the pessimistic mind!