If only some keys work, clean under the non-functional keycaps with compressed air. Dirt and debris is a common cause. For liquid damage, let the keyboard dry completely (24-48 hours) before testing again.
This is usually a driver conflict. Try plugging in the USB keyboard before your laptop boots, or update both keyboard drivers. Some laptops automatically disable the built-in keyboard when external input is detected.
Use the on-screen keyboard: Press Win+Ctrl+O (Windows) or click the Input menu in the menu bar → Show Keyboard Viewer (Mac). You can also use voice typing: Win+H (Windows) or Cmd+Shift+Space (Mac).
Yes, some malware can interfere with input devices. Run a full antivirus scan to check for infections. If your keyboard works in Safe Mode but not normally, malware is likely the cause.
Num Lock is likely enabled. Press the Num Lock key to turn it off. On some laptops, you may need to press Fn+Num Lock.
If the keyboard is built into your laptop and other fixes haven't worked, consider professional repair or an external keyboard. For desktop keyboards, they're usually replaceable. Weigh the cost of repair vs. replacement.