Exoplanets are discovered using various methods. One of the most successful is the radial velocity (RV) technique which can indirectly reveal a planet candidate. Using stellar spectra and the Doppler effect, scientists measure the velocity of a star along the direction towards it: RV.
When the star moves away from or towards the observer, the stellar light becomes respectively redder or bluer. If RV varies periodically, one can suspect a second body orbiting the same gravity center as the star. This can be a planet or another star.
The range of RV variations provides a minimum mass of the unseen body: the larger range, the heavier second body. We can infer only a minimum mass from RVs, because if the orbit is inclined with respect to the observer, the RV range is reduced, while the orbit inclination cannot be determined from stellar RV.