A planet is millions or billions of times fainter than its star and sits inside its glare. Five techniques have produced almost every confirmed detection.
Radial Velocity (Doppler Wobble)
A planet and its star both orbit their shared center of mass. As the star moves toward us its light is slightly blue-shifted; as it moves away, slightly red-shifted. High-resolution spectrographs can measure these shifts down to ~1 m/s — a walking pace. This is how 51 Pegasi b was found and how Proxima b was confirmed. Best for massive, close-in planets.
Transit
If a planet's orbit is edge-on from our viewpoint it crosses in front of its star once per orbit, blocking a tiny fraction of the light — typically 0.01% to 1%. Repeated, periodic dips betray a planet. This is the workhorse method for Kepler and TESS, and it accounts for the majority of all known exoplanets. The geometry has to cooperate, so transits only catch a small fraction of existing planets, but the ones it catches are extremely well-characterized: we get the planet's radius, and follow-up radial-velocity measurements yield the mass and therefore the density.
Direct Imaging
The hardest method — literally photographing the planet. It requires a young, bright, self-luminous planet far from its star, plus heroic optics (coronagraphs, adaptive optics, starshades) to suppress the host's glare. The classic success is the four-planet system around HR 8799, where all four giants have been resolved and tracked along their orbits. Beta Pictoris b is another benchmark. The method also produces cautionary tales: the famous Hubble "image" of Fomalhaut b (2008) was later shown by Gáspár & Rieke (2020) to be an expanding dust cloud from a planetesimal collision, not a planet at all. Direct imaging gives us spectra of the planet's own atmosphere, which is otherwise extremely hard to obtain.
Gravitational Microlensing
When one star passes precisely in front of another, its gravity bends and magnifies the background star's light. A planet around the foreground star adds a brief secondary spike to that brightening. Microlensing is sensitive to planets at large orbital distances and even to free-floating rogue planets with no host star at all — a population estimated to rival the count of stars.
Astrometry & Pulsar Timing
Astrometry measures the tiny side-to-side wobble of a star against the sky — ESA's Gaia mission is expected to deliver thousands of detections this way. Pulsar timing watches the cadence of a pulsar's radio beam for orbit-induced delays; it is exquisitely precise but only works for the rare handful of stars that are pulsars.