Test a USB-drive/SSD for bad sectors/blocks?
Open the Terminal.app in Applications/Utilities.

Cut and paste this inside to install Brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install e2fsprogs with brew:
brew install e2fsprogs

Type diskutil list to find your device (/dev/diskX)

Run badblocks on your device: (replace the X with your device number)

/usr/local/Cellar/e2fsprogs/1.44.3/sbin/badblocks -v /dev/diskX