Probably Sticky, Not Damaged
There are keyboards that are marketed as “spill proof”, but most keyboards are made so that water is unlikely to get inside the individual keys. And most keyboards are made with holes so water spills can be gently shaken out.
While it is possible that the liquid shorted something in the keyboard, and it’s damaged, that doesn’t happen often.
Cleaning Liquids You Can Use
Wouldn’t distilled water be a good way to get the wine or soda out? A little bit of mild dish detergent can also help, maybe two drops in a bowl of water.
But don’t use unfiltered tap water, you don’t want any chemicals in your water eating at the plastic of the keyboard. If you live in an area with hard water, you shouldn’t use even filtered water, since those minerals can mess up the tiny levers of your keys. Or, understand that if the keyboard starts getting “sticky”, you’ll replace it.
Power Completely Off
Turn off your computer, all the way off not just low-power mode. Unplug the keyboard from the computer.
Find the old toothbrush that you kept for cleaning electronics, the one that has a rubber band around it so you never again put it in your mouth.
Not the toothbrush you use for cleaning bathrooms or cars or anything else, that now has traces of harsh chemicals on it.
A camera lens brush “so old you can replace it” would be great. Just don’t later use the keyboard brush on an expensive camera lens.
You’ll also want compressed air (those small cans, specially made for use on electronics). They usually have a tiny straw to get the air into tiny places.
First, use the toothbrush and compressed air to get the crumbs and dust and pet hairs from the entire keyboard.
Then check for all the places where there is dried wine visible.
Notebook Computers Need More Cleaning
If you have a notebook computer, the keyboard was probably designed to keep spills out of the rest of the computer.
Hopefully, tipping the computer to let liquids drip out, is all that is needed to keep liquids from the rest of the computer.
After removing “most” liquid, remove the keyboard from the computer. That is usually one of the easiest things to remove from a notebook computer. Find your specific model’s repair instructions, and follow those instructions exactly. It probably requires remove a few screws, slide the keyboard so it is away from the rest of the case, then carefully disconnect the keyboard cable.
Check carefully for any signs of liquid in the rest of the notebook. Warning: likely any liquid on a notebook battery will cause corrosion, and with some batteries that could be dangerous. Maybe it is time to replace it with a new battery.
Keep yourself grounded (touch any large metal piece of electronics, maybe the bare-metal screw on a power strip) working in a notebook computer. Use only all-natural cloth (cotton, hemp, probably not silk) as nylon and polyester and so many other fabrics generate static. Wipe out all the liquid you can, then make sure the computer is completely dried before you power on again.
Don’t try rinsing inside a notebook computer. Only use a damp cloth to soak up drinks. Any slight residue: probably best to completely ignore it. Or find a cleaner that is specifically designed for cleaning electronic circuits. Or have a computer repair professional do it.
Removing Keycaps (Only if needed)
Only remove a keycap if you cleaned most of the dried gunk, and the key still doesn’t work. There is a risk you will break the tiny clip the keycap attaches to, every time you remove and replace a keycap.
There are small plastic clips that hold the keycap in place. These clips are usually located on the top and bottom edges of the keycap.
Gently pry up one of the clips using a small screwdriver or other thin tool. Be careful not to apply too much force, as this could damage the key or the keyboard.
Remove Spilled Liquid and Dried-On Gunk
Pour water on the coffee or wine or soda, then very gently rub after it has soaked a few minutes, until there is none visible.
Rinse, then gently shake water off the keyboard, many angles to get water out of all the corners and edges.
Let the entire keyboard dry thoroughly. Do not put any keycaps you removed back on, until it has dried thoroughly.
Maybe have a dish with a puddle, next to the keyboard, and you can only proceed when the puddle is completely dried.
Gently Put Keycaps Back On
If you have the keycap in exactly the right position, it will snap on with very little force. If it doesn’t snap on with very little force, you have it positioned incorrectly, even if by 0.1 millimeter, or one degree off the correct angle.
Do not use more force, you can very easily break the tiny clips the keycap attaches to. Use the minimal force to depress the key, plus ever so slightly more.
Keep gently trying, and suddenly what you did, seemingly no different than what you did before, will work.
Get A New Keyboard
If that sounds like too much work, or if the keycap breaks, buy a new keyboard. Or your friend probably has a keyboard “that came with their old computer” and you can have it.
Notebook replacement keyboards are available, just make sure it is for the exact model computer you have. Or, leave the bad keyboard in the notebook and use a USB keyboard. (If the whole keyboard is defective, you have to replace it, don’t leave blown circuits in the notebook.)
Keyboards on Amazon or at the swap meet, are inexpensive, especially if you don’t have to have the expensive brand. If the reviews of a keyboard aren’t “crappy feel” then you’ll likely find it is just fine.
If you need a keyboard “right now!” any Windows keyboard will work on a Mac, use the “windows flag” and the “Alt” keys, you’ll figure it out.
Don’t Do It Again
Now that you’ve done all that work, maybe you will change to “only water in a closed container” at the computer desk. No crumby or oily snacks.