Hi, This really depends on how it has 'gone wrong'.
If it's a hardware failure then nothing you can do will sort it out.
But if it's a software/format failure then;
Save everything you want off of it with a program such as 'Recuva'. https://www.piriform.com/recuva/download
Then Format it again by;
Right-click on the Flash drive's icon in 'explorer' or 'Computer',
Choose 'Properties' from the list,
Set the option of FAT 32,
Untick the 'Quick format' option, so that you are using the slower full format option.
Note that all the files that were on it will be gone, so be sure to save any valuable files first, if you can.
Hi, That is the way to repair any flash memory, if the fault is because of a software failure. Which means a corruption of a program or files or the structure of it.
It won't fix issues with the electronics which are embedded in the PCB that control the way the memory is used, if that's faulty then it's finished.
It's worth noting that you can't defrag flash memory either.
The better way to 'clean up' flash memory is to copy the entire flash memory contents/files/folders to a hard drive. Format the flash memory, then copy the original files back onto the flash memory again. That way all the free space will be together, not spread all over the memory chip.