Follow these steps to clean up after your pet if they soil your carpet:
First carefully remove the solids first using an inside out plastic bag over your hand. Turn it right side out to fully enclose the contents.
Blot any urine with paper towels.
Wet the affected area with an enzymatic odour removing/controlling cleaner available from pet shops.
Rinse the residue with water to avoid leaving any smell that may attract your pet to the same place
Make up a "Pet Accident Pack" just in case for any future mishaps...Keep paper towels, a sponge, plastic bags and your enzymatic cleaner etc. in a bag or box and keep under your sink....Ready for next time.