So the most logical place to start for this sort of 'humanity guarantee' would be Mars, which shares an oddly large amount in common with Earth. There's a verbose (and rather entertaining read) with lots of first party commentary here. [1]
[1] - https://waitbutwhy.com/2015/05/elon-musk-introduction.html
This article is however very useful to bring pragmatism to the discussion.
Maybe the best insurance for humankind is to start shipping a continuous stream of robots to Mars to prepare human landing in many (many) years.
If that happened Earth itself would still, even during the extinction event, be a dramatically more pleasant place than Mars. But nonetheless that event would kill off the overwhelming majority of people on Earth, and very possibly 100%, because it's such a significant change from the status quo we expect to continue on Earth. But having a parallel society or societies would ensure that even in the 100% scenario, life could get back up and organized relatively quickly. And even in the "only" 99% of people killed scenario, the outside help could help to reestablish order and kickstart society.