macOS Catalina USB keyboard doesn't work after being taken out and in again
Reset NVRAM or PRAM on your Mac

Shut down your Mac, then turn it on and immediately press and hold these four keys together: Option, Command, P, and R. You can release the keys after about 20 seconds, during which your Mac might appear to restart.

Test after this.

If this doesn't help then at last try to:

Reset the SMC on Mac

First, shut down your Mac and Press Shift-Control-Option on the left side of the built-in keyboard, then press the power button at the same time. Hold these keys and the power button for 10 seconds. Release all keys. And, Press the power button again to turn on your Mac.

Start up in safe mode

Start or restart your Mac, then immediately press and hold the Shift key. The Apple logo appears on your display.

Release the Shift key when you see the login window. If your startup disk is encrypted with FileVault, you might be asked to log in twice: once to unlock the startup disk, and again to log in to the Finder.

To leave safe mode, restart your Mac without pressing any keys during startup.

This will release some kernel panic that might help to fix your issue too.