"Death of the Sun" - current thinking seems to be that the Earth will slip out of the habitable zone as the sun gets hotter in perhaps 1 billion years, long before the Sun starts swelling to a red giant.
As far as tech advancement letting species survive, any sf tech beyond "we can move some people to a another solar system" seems to me to be entirely fantasy, with no evidence it has been or could ever be achieved, so setting a timeline for it seems completely arbitrary. The sf idea that 'the
future' = 'ever more energy' emerged from the 19th through early 20th century experience of harnessing fossil fuels, and we see it a lot in sf originating in the ca 1910s-1960s, but society hasn't garnered significantly more energy per capita in at least sixty years now (since cars became widespread) and there's no indication that will change.
As far as tech advancement letting species survive, any sf tech beyond "we can move some people to a another solar system" seems to me to be entirely fantasy, with no evidence it has been or could ever be achieved, so setting a timeline for it seems completely arbitrary. The sf idea that 'the
future' = 'ever more energy' emerged from the 19th through early 20th century experience of harnessing fossil fuels, and we see it a lot in sf originating in the ca 1910s-1960s, but society hasn't garnered significantly more energy per capita in at least sixty years now (since cars became widespread) and there's no indication that will change.