First of all, turn it off, then don’t panic!
Water is usually a death sentence for electronic devices. That’s because water conducts electricity, passing it instantly from one component to another causing them to overload. Impure water (such as fizzy drinks or sea water) also contains impurities that bind to electronics and corrode them. These impurities stay in the device even when it’s dried, causing further damage over time. So it goes without saying that spilling drink on your Mac is not a good idea. Neither is using it in a humid or damp environment. Just keep the device as far away from water as possible.
The impact of water damage can be lessened if a Mac is fully turned off when it comes into contact with water. That’s because there’s no current inside the device that can be transferred from one component to another.
Second, don’t turn on a wet electronic device!
If you’ve accidentally spilled water on your Mac, then turn it off straight away and wait for it to fully dry both outside and in. Even if you’ve rubbed it down with a towel and blown inside the keyboard or ports, there will still be water inside the device that’s trickled in from numerous sources. At room temperature it will take days for the water inside to evaporate. But don’t worry, there are a couple of methods of quickly drying a water-clogged device.
The best way to dry a wet device
Avoid any heat sources. Hairdryers are hot enough to melt the solder inside a Mac. Similarly, avoid other heaters or sources of fire. Room temperature is your friend. The most efficient way to dry a wet device is to place it in a sealed container with silica gel packets. These are the same gels you find packaged with most large electrical devices, and they typically come in small paper sachets.
If you don’t have gel packets to hand, then be patient, the longer you can leave the Mac to dry the more likely it will still work when it’s turned back on. Good luck!