The sweep: every key, once
Work in rows so you do not lose your place: function row, number row, letters, modifiers, numpad. Watch the on-screen layout highlight each key as you press it, and note anything that does not. Press the keys you actually use most (WASD, space, shift, ctrl, enter) five or six times — intermittent failures love to hide in single presses.
Rollover and ghosting: the gaming check
Hold W, A, S, D plus shift and space. A keyboard with full N-key rollover keeps every key tracked; a membrane board may quietly drop one. Find your board's real limit by adding keys one at a time until something disappears from the display. This is the test that explains 'my character stops moving when I press space'.
Chatter and double presses
Press a single key once and look at its press counter: it should increase by exactly one. Two or more indicates a bouncing switch, the keyboard equivalent of mouse double-click chatter — most common on worn mechanical switches and on cheap membrane domes. Test the keys you type most, since those wear first.
What to do about failing keys
For an external keyboard, a failing switch is replaceable if the board supports hot-swap, and repairable by soldering if it does not. For laptop keyboards, a single dead key is usually a ribbon or a replacement keyboard module — check whether the key works in the BIOS or in a different operating system first, because that separates a hardware fault from a driver problem. Liquid damage gets worse over days, so back up your work before experimenting.