The film begins with government agents unearthing a refrigerator from the Nevada desert; the only known conveyance to have successfully protected a protagonist from the full brunt of a nuclear explosion.
Or how he managed to get to it. Any start exploding close enough for non-FTL technology to be a reasonable mode of transportation would also turn the Earth into dust or a molten ball of rock.
No problem... it turns out we reverse engineered a primitive FTL drive from the debris at Area 51, so we stick it onto a Space Shuttle, but it also turns out to be the only thing powerful enough to blow up the star, so it has to be detonated, sacrificing the ship.
However,the explosion also creates a wormhole that Bruce Willis bounces back into after blowing the star up, which lets him land safely back on Earth in a cool pose like Iron Man at the end.