If it is a removable carpet then take it out on the porch and wash it with powder detergent and water. This thoroughly cleans my carpets. Let it dry for a day and it should be ok.
If it can't be removed then i would suggest investing in a good quality vacuum.
To get rid of wet carpet, firstly drag that wet carpet outside into a garage if possible.Start by using your wet and dry shop vac to suck out as much water as possible then use fans or heaters to dry it. Use a good quality cleaning detergent, ammonia or sanitizer because these products are preferred to ensure all mold and bacteria is killed.This will remove the odor of your carpet completely.If damage is more then contact to expert professional cleaners.