How do scientists find planets around other stars?

You're standing in a dark field at night, and someone a mile away turns on a tiny flashlight. Now imagine a firefly lands on that flashlight. Could you see the firefly? That's basically what astronomers are trying to do when they look for planets around distant stars — except the "flashlight" is a billion times brighter than the "firefly," and they're both trillions of miles away.
Here's the problem: stars are enormous balls of nuclear fire, blazing with their own light. Planets are cold rocks or gas balls that only reflect a star's light — like trying to spot a grain of sand next to a searchlight. You can't just point a telescope at a star and see its planets hovering nearby. The star's glare drowns them out completely.
