Tech Columnist Ryan Whitwam published an article on cleaning the keyboard without breaking anything
Most people use laptops, so this is where we’ll start. Virtually every laptop maker has adopted a flat chiclet-style design to save space. If your board is just a little dusty, you can grab a can of compressed air and give it a puff. If you’ve let it go longer, you may need more extreme intervention.
TO CLEAN THE OILY RESIDE FROM KEYS THAT EVENTUALLY BUILDS UP ON YOUR SCREEN
To clean the oily reside from keys that eventually builds up on your screen, consider using a small amount of rubbing alcohol (91-99% isopropyl). Using a cotton swab, test the alcohol on a keycap that’s out of the way. Some UV-treated caps and those with low-quality pad-printed legends can be damaged by the alcohol. You can switch to water with a few drops of laundry detergent or diluted Simple Green if the alcohol is a problem.
If everything looks good after the test, start swabbing the keycaps. Use a new swab after every few caps, and don’t use so much alcohol that it drips all over. It should dry very quickly and you can get back to computing.
If you’ve got grime inside the keyboard on your laptop, you’ll need some tools. Apple’s butterfly switch and traditional scissor switches are similar when it comes to popping the keys off. You can use something like a guitar pick, but I recommend you get a toolkit (like the ones sold by iFixit) that include plastic and metal spudgers. They’re useful for so many thing.
TO REMOVE THE KEYS
To remove the keys, slip your tool under the top of the cap and gently lift it up. It should pop off without much force. With the keycaps off, use compressed air to blow out all the dust and hair. To put the key back, line the keycap up and push it back down starting with the bottom edge. Again, be gentle.
There are a few more intricacies when it comes to the external keyboards you plug in via USB. The basics from above still apply: use compressed air and clean keycaps with rubbing alcohol (after testing). If you’re worried about damaging the keycaps, you can use water with a few drops of laundry detergent or diluted Simple Green instead. Still use a cotton swab to control how much you apply to the key. Be extra careful with the legends on cheap keyboards—the pad printing might not survive a vigorous cleaning intact.
If you’re using a cheap membrane board (like the ones that ship with desktop towers), you might have to check with the maker to ensure the keycaps can be removed. All mechanical keyboards have removable keycaps. To get keycaps off, you can pry them up with a screwdriver or spudger. You really shouldn’t, though. To avoid damage, buy a wire keycap puller. They only cost a few bucks on Amazon.
With the keycaps off, you can blow all the grime out of your keyboard. If the keycaps are really, really dirty, you might consider soaking them overnight to get the dirt off. If you opt for this, do not use rubbing alcohol. Fill a container with lukewarm water, add your keycaps, and drop in a denture cleaning tab.
After cleaning, just push the keycaps back down where they go. A word of warning: if your keyboard has a wire stabilizer under larger keys like space and back space, they can be a pain to deal with. If you don’t absolutely have to remove them, don’t.