Scientifically speaking, here’s how we might prepare for the end of the world and steps we could be taking to protect humanity.