As it usually happens you drop the glass, cup, can or whatever you hold in your hand and drop the liquid inside your laptop. Needless to say that there follows the horror afterwards as you fear this accident will damage your Macbook really bad and you start wondering what to do if you spilled a liquid on your Macbook.
Of course you already know you shouldn't have done that and that it's not safe to drink anything while in front of a computer, so you have already learned your lesson, so you probably will not repeat this experience again. Then you should know that when you spill something inside your laptop the warranty won't cover for it, as it is considered improper use, that is your fault.

Now the first thing you do when something like this happens is to unplug the charger immediately and also remove the battery in order to avoid any short circuit that might be produced by the water getting into contact with a power source. Then you have to leave the Macbook in a dry place where it can dry. It may help if you bring some dry rice or some little bags of silica that is used in the shoe boxes for example that can reduce moisture considerably.
If you have disassembled a laptop before, you could try doing this now and removing the liquid that you will find inside, then simply leave it to dry for at least 48 hours. The luckiest incident is when your spilled liquid happens to be water, as it dries easily and does not leave any marks behind. But if the liquid is soda or juice or sweet coffee or tea it will turn into a sticky thick liquid as it dries and you can imagine that this is not good for your Macbook's functioning.

So now you definitely have to open the case of your laptop and clean the mess inside with some cotton swabs that are dipped in some clear water. Do not use any other types of cleaners like bleechers or solvents, as they can permanently damage your computer. When it is dried, reattach the power cable and battery and turn it on. You will see immediately if it works or not. If it doesn't just take it to an Apple specialist and pray for the minimum damage.
Now that you know what to do if you spill a liquid on your Macbook, you should consider avoiding this situation and stay away from drinks and food while using the Macbook.