Jupiter has a huge influence in the Solarsystem, the big gravitation of Jupiter and also the Sun can deflect most of the asteroids and Comets from the Earth orbit, but in certain circumstances can do the opposite and launch objects into Earth's orbit, depending on what angle they enter the system..
A good example is Apophis (∅~370 m), which is coming to visit us in 2029, although at quite a distance, but it will return in Abril 2036 and in this case, if it passes through a certain point there is a possibility that it will impact the Earth..
*removed externally hosted image*
https://neal.fun/asteroid-launcher/
Simulate an impact where ever you want and see the consecuences scrolling down the results.
Do we have ways/plans to prevent the potential hit or is it a "we will see" thing?
There are several plans to avoid it, but it depends of several factors. We can avoid an impact if we know the exact position several Years before the supposed impact, if not, there is nothing we can do.
Watch Don't Look Up. It's about an asteroid heading for earth in our current political climate
Explain to me, how is Jupiter deflecting a significant number of asteroids if it can only be in one place at any one time and its orbit is nearly 12 years long? Wouldn't asteroids have a huge window to get past it while it's on the other side of the sun?
Same thing for Earth, it can only be at one place at anytime, creating a huge window for any asteroid to missed earth. And when it missed, it must loop around and orbit the sun, multiple times, increasing the chance of it got caught in Jupiter's gravitational well, which is a pretty massive distance.
Orbital mechanic is crazy and make no sense for a peasant like me. You would think hitting the sun is the easiest thing but It's actually really hard to launch something into the sun. And would require an enormous energy to do so.
Ever wonder why don't we just launch our nuclear waste into the sun? I thought so too and do some Google search about it. It was an interesting read.
Stop right there, criminal scum! Nobody breaks the law on my watch! I'm confiscating your stolen goods. Now pay your fine or it's off to jail.