There are a few things you can do to absorb the liquid and clean off the coffee from your laptop computer if you've had a spill.

If you spill coffee or any other liquid on your computer, the very first thing you need to do is turn it off as quickly as you can and disconnect all power sources, including (and especially) the battery. Having any power made available to the circuits of your computer while they are wet can irreparably damage the laptop.
Next, use highly absorbent material to clean up all of the liquid you can see. Anything around or on the computer should be cleaned so that you will not accidentally spill more into the computer’s case when you move it.
Inspect your keyboard and clean out any liquid you’re able to before flipping the computer over.
Now that you've cleaned the coffee spill on the laptop's surface, you need to make sure you don't have any other liquid that you can't see:
Now you know how to clean a coffee spill on a laptop and hopefully your computer will be able to work despite the spill.