There’s a good answer for that. And we’re going to explain it. Right now! How exciting.
Planets outside the Solar System, or exoplanets, are comparatively easy to find because we can see the effects of their orbit on stars. We have a number of methods for finding exoplanets, but pretty much all of them are related to this.
The most famous, and perhaps the one you’ve heard of, is the transit method. From our position, if a planet crosses across its star, we can see the dip in light that causes.
Measuring three of these dips, we can work out the mass and orbit of the planet. Not all planets transit their star with respect to us, however, so we can’t use this for every star.
Another method is called radial velocity. This involves noting the tiny, tiny gravitational tug a planet exerts on its star. For smaller planets in wide orbits, this is incredibly difficult, but for larger planets in tighter orbits, such as hot Jupiters, this can be quite useful.
Then there’s gravitational microlensing, where we can see a more distant star being magnified by the gravity of a closer star. If there’s a planet in orbit, we can sometimes see a small deviation in the light from the distant star. This method is pretty much the only way we’re able to find rogue planets, those wandering without a star, by noting their gravitational effects as they pass in front of other stars.
But in our own Solar System, things are a bit more tricky. We can’t really use these methods to see Planet Nine or Planet Ten, except maybe microlensing, because they don’t pass near the Sun relative to us. We can, however, guess where they should be.