It is never a good idea to just pull out a USB device from your computer.
There are a number of ways to safely remove it from your computer but one way which is common to both MACs and Windows PC is to open your filing system (Finder on the MAC, and File Explorer on the Windows PC).
Find the device in your list of devices on the left hand side panel.
Right click on the device and left click on eject.
Wait for a pop up to appear that lets you know it is now safe to remove the device.