If you spill wine, tea, Coffee, juices or any other substances, the first step is to remove or sponge the excess liquid by a spoon or by a white towel or a non dyed cloth or tissue paper.
Sponging should be done till the substance has been wiped off.
Different stains got different techniques to remove.
Here are some common ones:
When fat spills on you rug, first remove the excess with a spoon and then put a non dyed cloth over it and press slightly with hot iron. With doing this, the cloth will absorb the fat.
Please bear in mind that these are only some guidelines and the job should be done by a professional.