"Windows was unable to complete the format" is a error that may occur to both SD cards and USB devices. This can be due to many reason like bad sectors in the disk or may be result of a malicious activity by a program like virus or a worm. It can also be caused if the SD card or a USB is damage. Windows will not able to format it and gives an error shown in the image.
There few ways to make your device work again but this tutorial fix this issue by ussing an android phone. If you have a SD card put in phone. If you have USB connect it via OTG cable. Next go to settings of your phone and Tap Storage.
Android will not recognize it yet. In storage go the bottom of the page and Tap Erase SD Card. Confirm it and give some time to it, it will delete all the partitions and create a new one and format it with FAT file system. The newly formatted device is show like the below image.
Now just plug your SD card or USB in your Windows machine it will be working as if it was new.