Before the sun dies, it will grow large enough to engulf the Earth. This will make solar energy a highly efficient form of energy. Our proximity to the sun, or more specifically, our location inside it, will likely cause most fossil fuels to combust, thus making it an unreliable form of energy. Overall though, to get the most out of whatever energy source we do have, I would suggest relocation to a planet further from the sun at least, and hopefully to a solar system whose star isn't dying. All donations for said cause can be sent to Al Gore's Apocalypse Fund.