Formatting a USB device may remove any existing data or files on the device, but it does not guarantee the removal of a BadUSB infection.