If you spill a liquid on your laptop, whether water or something as sticky as coffee, the key to possibility preventing damage is to act quickly. Any type of liquid can damage your system and will involve costly repairs or in many cases, replacement of the laptop. Also keep in mind that most warranties will not cover damage from spills or exposure to water.
Turn off your computer immediately and do not turn it back on until your system is completely dry. Doing so will likely cause damage to the system.
Unplug your laptop from the electrical socket and unplug all devices connected to the laptop. Remove those devices from the laptop as well.
Take out the battery from your laptop and set it aside.
Wipe down the outside your laptop with a soft, dry cloth with gentle pressure. Turn you computer over on it side, partially opened, so that all liquid can drain out from the laptop. Leave the laptop in this position for 48 hours so it can dry out completely. Never attempt to use a hairdryer to dry out your laptop, as this may damage internal parts.
Turn on your computer after 48 hours. If your computer will not turn on after you put the battery back in and plug in the system, you will need to take your computer to a technician for examination to see if it can be fixed.