This device is currently waiting on another device (Code 51)

The thing about the situation is that there is no fixed resolution. It is best to wait for a few minutes, but if the issue stays around much longer, then here is what you can do: Your account should be an administrator account to execute these suggestions.

1] Unplug and replug the hardware

If the device causing this issue is hardware, which you can remove and unplug easily, we suggest doing that. Once unplugged, wait for a few minutes and then replug the hardware. There is a good chance that it will start working. Once the device is removed, all related things are cleared from the system after a while.

2] Restart Computer

A restart fixes a lot of things, and it can fix this too.  You can also check if other devices failed in the Device Manager because of which this device has gone into internal wait. Restart your computer or fix other devices to resolve this.

3] Run the Hardware Troubleshooter

The built-in troubleshooter in Windows offers hardware troubleshooter which can resolve a lot of these types of the problem by performing operations such as restart or reset on its own. You need to execute the following command msdt.exe -id DeviceDiagnostic either from the run prompt or the elevated command prompt. Let the wizard do what it is programmed to do, and hopefully, it will resolve the problem for you.

4] Remove and Reinstall the Device

Open Device Manager using (Win + X, followed by M) and locate the device which shows the error code. Right-click on the device, and choose to uninstall the device. Then click on the Action menu, and select the Scan for hardware changes option. This process will scan all the hardware input, add the device we removed, and install the drivers. It is almost like a reset, but a lot faster. I hope this helps.