Pulling a USB drive without ejecting it can leave files half written. The old habit is dragging the disk icon to the Trash, which always feels a little scary. There’s a key for it.
Select the disk in the Finder sidebar or on the desktop and press Command-E. Apple’s shortcut list describes it as ejecting the selected disk or volume.
select the disk in the sidebar
Command-E eject it
File > Eject same, from the menu
It’s the same for a USB stick, an external drive or a mounted disk image. Wait until the disk disappears from the sidebar, then unplug.
A habit that helps: make sure the sidebar shows external disks. In Finder > Settings > Sidebar you choose which items appear there, and with the drive listed you can click it and press Command-E in one go.
If the disk refuses to eject, I’d look for an app that still has a file from it open, or a copy that’s still running. Close that, wait for the copy, and try again. Pulling the cable at that moment is how files get damaged.
One thing that trips people up: Command-E is a Finder shortcut. In other apps it means something else, so click the desktop or a Finder window first so Finder is the app in front.
Further reading: Mac keyboard shortcuts (Apple Support), Change Finder settings on Mac (Apple)