How do you fix a roof leak?
Start by finding the source, which is usually uphill of the interior stain: damaged or missing shingles, cracked flashing around a chimney, vent, or skylight, or failed pipe boots cause most leaks. A temporary fix is roofing cement or a patch over the damaged spot plus replacing broken shingles; a lasting fix repairs or replaces the flashing or shingles properly.
Flashing failures, not the shingles themselves, cause a large share of leaks, so inspect every penetration and wall junction. If the deck underneath is wet or rotted, that has to be replaced too.
For an active leak, get water off the interior and tarp the area until it is dry enough to repair. Recurring or widespread leaks usually mean the roof is near end of life and needs replacement rather than another patch.