A dog has accidents every now and then---whether it is because it is old, sick or you left it in too long. Usually if the poop is solid, you'll have no problem cleaning it up. It generally does not leave a stain, but if the dog has diarrhoea, it can be difficult to clean up, and it may leave a stain--especially if you did not catch it right away, as often happens if the dog has an accident while you are at work.
Pick up any solids (use newspaper, paper towels or disposable gloves) and discard in the trash or, if you have a "doggie dumpster" for your septic tank, into the doggy dumpster. Spray the stained spot with a high-traffic cleaner. Rub it into the stain, using a hand brush, and allow it to soak for 10 minutes.
Fill the carpet steam cleaner with cold water. Go over the spot with the steam cleaner until you notice the stain lightening up---it usually takes three or four times. If you do not have a steam cleaner, go over the spot with the brush scrubber, and wash the area with a hot, damp towel. Repeat as necessary until the stain starts to lighten up. If you prefer to use a carpet cleaner, most large supermarkets rent out Rug Doctors.
Spray the stained area with high-traffic carpet cleaner again. Work the cleaner into the stain with a brush scrubber. Allow the cleaner to set for 10 minutes.
Repeat Step 2 with the steamer or the brush if you are trying to clean the carpet by hand. Repeat until the stain disappears. If you caught the mess right away, you may only need to go through the process once, but if the stain has had time to set, it may take more than two or three times before the stain starts to lighten up.
Pour vinegar onto a clean towel. Rub the vinegar into the carpet. This will help to alleviate any smell that is left. Soak up any excess liquid with towels or the carpet cleaner.
The sooner you find the mess and clean it up, the less likely it is to leave a stain. The more you work the stain, the lighter it will get. In most cases you can completely remove the stain. In some cases you may have to wait a couple days and repeat the process.