Over time your computer keyboard will get dirty and need cleaning. The keys are perfectly designed to collect dust and germs. Periodic cleaning can help keep your keyboard working and looking like new.
Before any cleaning, it is best to disconnect the keyboard from your computer. You may also want to move it outside to make cleaning up easier.
Turn the keyboard upside down and gently shake out debris stuck in the keys.
Use a soft brush and compressed air to blast out more stubborn things left behind. Compressed air can be purchased in cans or alternatively use a powered air duster.
Another option is keyboard slime if you attempt to clean with air and shaking the keyboard fails. Be careful not to exceed the price of a new keyboard if you are using a standalone desktop keyboard. The cheapest wired keyboards are ~$15-20.
Clean around the keys with a cotton swab dipped in isopropyl alcohol. Be careful to not use too much isopropyl alcohol. Wipe the cotton swab on a paper towel after dipping in alcohol to reduce the amount applied to the keyboard. The alcohol will help kill germs and sanitize your keyboard.
If you find your keyboard getting dirty too often, consider purchasing a keyboard cover.