If you ever need to format a USB thumb drive on macOS from the command line, this will get you going. The first command will show you the drives so you can figure out which one is the USB. You will want to swap out DRIVENAME for what you want to name the USB drive.
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 DRIVENAME /dev/disk2