An artist’s concept shows an asteroid called Vesta, one of the biggest objects in the solar system’s asteroid belt between Mars and Jupiter. It is so large that it almost reaches a size that would allow it to be classified as a dwarf planet. NASA/JPL-Caltech/UCLA/MPS/DLR/IDA

If scientists spotted an asteroid coming for Earth and didn’t have a lot of time to react, they would send a bomb out into space to take care of it. But they hope they never have to face that situation.

NASA has described three different methods of dealing with asteroids that threaten our planet, all of which involve changing the objects’ trajectories. According to the space agency, it could launch a large spacecraft and use the vehicle’s gravity to slowly and carefully draw the asteroid away from Earth; crash into the asteroid to change its speed and course, using one or more spacecraft that would serve as “kinetic impactors”; or, in an “Armageddon”-type plan, detonate a device that would blow off the asteroid’s surface material and send it in another direction like firing a rocket would.

Read: NASA Uses Incoming Asteroid As Test of Earth’s Defenses

“This is a last-resort measure,” Lindley Johnson, the head of NASA’s Planetary Defense Coordination Office, said. “Though quite effective if time is short, it would take a lot of coordination and approval not only within the U.S. government, but also with the international community.”

As Johnson notes, it is all about how much time scientists have. NASA has previously pointed out the issue with using a kinetic impactor: Even if one or more were available immediately upon incoming asteroid detection, they would still need “at least one to two years for smaller asteroids” in lead time, and way more than that if a kinetic impactor needed to be designed and built from scratch or if the asteroid was larger.

The solar system is full of potentially hazardous objects, like asteroids, that scientists keep their eyes on. This illustration shows the orbits of more than 1,400 of these asteroids. NASA/JPL

This is one reason that astronomers keep their eyes peeled for asteroids — they want to detect them as early as possible. To that end, NASA’s Center for Near-Earth Object Studies is on watch and maintains a database of objects that are passing within Earth’s vicinity, including tracking those that may pose a collision threat to the planet.

“The rate of asteroid discovery has increased considerably,” Johnson said about the last couple of decades. There are almost 8,000 objects currently being tracked, but the solar system is far from completely covered: “We believe there are still over twice that number out there to be found.”

Read: Is a 10th Planet Hiding Among the Asteroids?

When a menacing asteroid appears, scientists don’t want to just wing it. One way they are preparing for such a scenario is using a flyby in October as a sort of drill. When asteroid 2012 TC4 comes by, somewhere between 4,200 and 170,000 miles away — closer to Earth than the moon even at the extreme end of the estimates — NASA will attempt to track the small object with the help of observatories and labs around the world.

“This effort will exercise the entire system, to include the initial and follow-up observations, precise orbit determination, and international communications,” the University of Arizona’s Vishnu Reddy said in a statement last week.

It might seem like a wasted effort to prepare for the remote possibility that an asteroid would strike the Earth, but it’s not as rare an event as it sounds. Hundreds of people were injured in Russia in 2013 when a space rock — which scientists had not detected ahead of time — streaked through the sky above Chelyabinsk and the resulting shockwave blew out windows all over the city.

“Asteroid impacts are predictable and now preventable,” Johnson said. “If we can find them before they strike, we can precisely predict their paths and time of possible impact. And we now have the space technologies to divert them.”