The transit method
If an orbit is aligned with our line of sight, a planet crosses its star and blocks a little light. Repeated dips give the orbital period. The depth of a dip helps estimate the planet’s size relative to the star.
The radial velocity method
A star and planet orbit their common centre of mass. Motion towards or away from us shifts the star’s spectral lines. Measuring this motion constrains the planet’s mass, with an ambiguity that depends on orbital inclination.
Putting measurements together
For a transiting planet with a measured mass, astronomers can estimate average density. This helps distinguish candidates with substantial gaseous envelopes from compact rocky worlds, though several interior structures can fit the same observations.