If your USB device isn't working properly with your desktop computer, there are a few troubleshooting steps you can take to get it up and running again. Start by connecting the device to another USB port. If it works, then the problem is the first port; if the device isn't detected, it's a faulty device. You may also need to reinstall the USB drivers or replace the USB drive if you can't reformat it.
Additionally, you can try connecting the device to another computer and ejecting it from there. This helps if the USB device isn't recognized. If you have multiple USB devices, you may need to connect a USB hub to one of your ports. This will allow you to connect even more devices.
You should also check for any hardware updates that may be missing in Windows due to software problems or malware interference. If none of these solutions work, consider a professional data recovery and disk repair service. This will help your computer recognize a USB device and prevent the external USB drive from turning off. You can also try disabling the 'Allow the computer to turn off this device to save energy' checkbox on the Power Management tab of the USB root hub.
Finally, if you have a PS2 port on your computer, you can turn off the USB in the BIOS if your keyboard and mouse are connected by USB. This is known as USB selective sleep and is an energy-saving configuration that cuts off the power of the USB device and reduces battery usage.