Artist's concept of a rocky planet in orbit around a distant star.
The star and its planet orbit around each other. The planet moves in a wide orbit, while the star just appears to wobble slightly. By measuring the Doppler shift of the light coming from the star, scientists can detect the tiny motion caused by the planet. Most of the distant planets were discovered this way.
If we are lucky, some of the planets can pass in front of their star. This blocks out some of the light that we usually see from the star, briefly making it dimmer. It's like a solar eclipse, but the planet only covers a small part of the star. Only a few planets outside our solar system pass in front of their stars.
All of the distant planets are too far away to see directly. We can only see their effect on the star that they orbit.