Transits
A transiting planet dims its star by (Rₚ/R★)². Kepler and TESS monitor hundreds of thousands of stars for periodic dips. Transit timing, duration and shape reveal the period, size, orbital inclination and sometimes additional planets through timing variations.
Radial velocity
A planet tugs its star in a small orbit, Doppler-shifting the star's spectrum. The semi-amplitude K gives the planet's minimum mass, m·sin i. Combining radial velocity with transits yields true mass and radius, hence density — rock, water world or gas.
Other methods
Direct imaging blocks starlight with a coronagraph to photograph young, hot giant planets far from their stars. Gravitational microlensing detects planets by how they bend a background star's light. Astrometry, now being exploited with Gaia data, measures the star's tiny wobble on the sky.
Atmospheres
During a transit some starlight filters through the planet's atmosphere. Transmission spectroscopy with JWST has detected water, carbon dioxide and sulfur dioxide in exoplanet atmospheres.