First, you need to remove as much of the liquid as possible. You can either blot it up with white paper towels or cover the spot in table salt to absorb the liquid. If using towels, be sure to blot gently. The salt can be vacuumed or brushed up with a dustpan after it dries.
Good Housekeeping recommends that you sponge the remaining stain with plain water or a mixture of liquid dish detergent, white vinegar, and warm water. Then, use cold water to sponge it up more before blotting it dry. Liquid detergent and cool water can be used for upholstery cleaning in addition to carpet cleaning. For rug cleaning, simply soak the spot in cold water, treat it with a stain remover, and launder it.
Another trick is to fight wine with wine. Instead of using water on a red wine stain, try white wine. To ensure that you remove as much liquid from the carpet as possible, place a thick layer of white paper towels on the spot and cover it with a heavy object overnight.
If any of the stain remains, call professional carpet cleaners, who may use steam cleaning and other methods to complete the job.