How can I format my USB?
Unplug your usb stick
Restart your mac
Download gdisk from https://sourceforge.net/projects/gptfdisk/files/latest/download
Double click the package and install gdisk.
Then open up your terminal and type diskutil list
Find the usb disk that you are trying to erase (/dev/diskx)
Unmount the disk you are trying to erase with diskutil unmountDisk force /dev/diskx
type use gdisk on the disk you want to erase. sudo gdisk /dev/diskx
Once in gdisk, type x for expert command and press enter.
Type ? to verify you are in the expert menu. Look for zap (destroy) GPT data structures and exit
Type z
When asked if you would like to delete the MBR partition also, type YES and hit enter.
Gdisk will now erase your GPT and MBR and tell you it is now okay to reformat in disk utility or another partitioning utility. Do so, and let us know if you can now format your disk.


IF NONE OF THIS WORKS. TRY THE FOLLOWING:


Unmount the disk you are trying to erase with diskutil unmountDisk force /dev/diskx
Use the DD command to erase your USB stick with zeros by entering sudo dd if=/dev/zero of=/dev/rdiskX bs=1m, where diskX is the usb disk you want to erase. This will take a long time. Please be patient.


FINALLY IF THAT DOESN'T WORK...
Create a linux live cd like linux mint, and boot from it. Then use gparted to erase and format your usb.

IF NONE OF THESE WORK...
Then your usb stick is most likely bricked and has hardware failure. Throw it out.