Yeah, i think the rocket may be the best option, you can't really escape earth with anything else, you can also bring some food along with you and some other people before the 24 hours are up.
Theres actually 3 ways I think the rocket can be used
Asteroid going to blow up the earth: fly the rocket into the asteroid, the shear speed should destroy or severely damage the asteroid, might end up you being oofed if theres no auto-pilot mode though.
Planet going to commit die for no reason: fly the rocket to another habitable planet
Sun going to commit explode, taking the earth with it: collect a whole lotta plant seeds and plant pots ( and maybe fertilizer too ), fly the rocket out of the sun's range, plant those seeds into the plant pots, and turn the rocket into a mini plantation. you may die, but evolution might be able to go in the right path and plants will adapt to space conditions and so on. before this happens though, you should eventually create an ai system thing which will maintain the plants and the ship long after your death. dont know how to code? just bring an internet service provider thing and go to youtube and other websites, that should be able to help you.