Hypothesis: In application of the laws of thermodynamics (conservation of energy) it could be that the sun's energy was (almost) depleted to perform feats of magic (energy was taken from the sun).
Question: Facing an imminent supernova, how can magic save the sun from dying?
Condition: The solution should respect the law of conservation of energy.
See for answers in a SF context: How would an advanced alien race go about preventing their sun from dying?
Would there be any theories in a pure fantasy context? It does not seem feasible for a fantasy world's population to leave the world as they do not in general have the means to colonize or terraform other planets or even get there for that matter (barring teleportation magic, but if you don't know where you're going, how can you teleport there?). The sun's survival is a therefore a necessary condition for survival of such a population.
Maybe magic could be used in a more conservatory manner, but that would only delay the inevitable. Maybe an incredibly powerful wizard could transfer energy from one star to another, but this feat would surely be too much for any single (believable) wizard. Quid?