8 July 2017 Last updated at 07:58 BST
The chance of an asteroid actually hitting the planet is pretty remote but it's a concern being explored by space agencies around the world.
Now it looks like Nasa and the ESA (European Space Agency) may have come up with a solution.
They want to test their plan, called the Double Asteroid Redirection Test (DART), in 2022 when an asteroid will pass by Earth.
If the test works it will be the first time an asteroid has been deliberately knocked off course.
Watch to find out more.
Courtesy of Nasa/John Hopkins University Applied Physics Laboratory
How do you stop an asteroid hurtling towards Earth at hundreds of thousands of miles an hour?