As the legend George Carlin once said, “the planet is fine, the people are fucked”. Although most animals and a bunch of plants are fucked too.
Now that being said, I don’t think that means we should start colonizing Mars or that things would be any better out there.
[1]: https://www.sciencefocus.com/news/earth-lost-60-per-cent-of-...
I don't think humans will be around long enough to deflect an asteroid that's big enough to do this, as it could easily be hundred or thousands or tens of thousands of years before it might get hit by one big enough to do this again.
When I was young I would assume we would be around that long, but I don't see a path to escaping our own destruction (possibly not total, but 90% or more of the total population, probably) within the next few hundred years at most, possibly sooner.