Carpet is a beautiful addition to the home, but it's never good when it becomes wet. Regardless if it's a spill, a leak, or a flood. The most important thing is that you start cleaning it as soon as possible. If water is left on carpet the water, it will eventually seep down underneath the carpet to the pad and then to the subfloor.
Start by moving all furniture out of the way, follow that by using towels to soak up as much water as possible. Then use a vacuum to suck up all that water the towels couldn't reach. Once you've sucked up as much water as you can, you'll want to bring in a fan, heater and or hair dryer to start drying the carpet.
Unfortunately if this does not fully dry the carpet the next step will be to pull up the carpet and let it air dry. Your biggest concern now is the padding, if the padding gets wet it will need to be replaced. Padding when wet will cause molding and will ruin your subfloor. The carpet can be reinstalled after it dries, but the padding will need to be replaced.