First, try to soak up as much of the moisture as possible using paper towels.
Press down firmly and blot, refrain from scrubbing.
Once you remove the moisture rinse thoroughly with cool, clean water and blot again.
For stained spots try mixing 50% vinegar and 50% water. Apply liberally so that it will soak down into the carpet. Use a scrub brush to work the solution into the carpet, and blot with a clean towel.