How to repair a Mac storage device with Disk Utility
Disk Utility can find and repair errors related to the formatting and directory structure of a Mac storage device. Errors can lead to unexpected behavior when using your Mac, and significant errors might even prevent your Mac from starting up completely.
Before you begin
Make sure that you have a current backup of your data, in case you need to recover damaged files or Disk Utility finds errors that it can't repair.
Open Disk Utility
If you’re repairing your Mac startup disk or your Mac doesn’t start up all the way, start up from macOS Recovery. When you see the list of utilities in Recovery, select Disk Utility, then click Continue.
Disk Utility is also available in the Utilities folder of your Applications folder.
Use First Aid in Disk Utility
From the menu bar or toolbar in Disk Utility, choose View > Show All Devices (if available).

The sidebar in Disk Utility now shows each available storage device, beginning with your startup disk. Listed under each device are any containers, volume groups, and volumes on that device. Your device might not have a container or volume group, and it might have a different number of volumes. Don't see your device?
In the following example, the startup disk (APPLE SSD) has one container (Container disk4), a volume group (the first Macintosh HD), and two volumes in that volume group (the second Macintosh HD and Macintosh HD - Data). To show all volumes in a volume group, you might need to click the arrow (>) next to the name of the volume group.

For each device that you're repairing, start by selecting the last volume on that device. In the example above, Macintosh HD - Data is the last volume.
Click the or tab, then click Run (or Repair Disk) to begin checking the selected volume for errors.
If the button is dimmed and you can't click it, skip this step for the disk, container, or volume you selected.
If asked for a password to unlock the disk, enter your administrator password, which is the password you use to log in to your Mac.
After Disk Utility is done checking the volume, select the next item above it in the sidebar, then run First Aid again.
Keep moving up the list, running First Aid for each volume and volume group on the device, then each container, then finally the device itself.
When done, quit Disk Utility. If you used Disk Utility from macOS Recovery, you can now choose Restart from the Apple menu to restart your Mac.
If Disk Utility can’t repair or see your device
If Disk Utility found errors that it can't repair, use Disk Utility to erase (format) the disk.
If your storage device doesn’t appear in the sidebar of Disk Utility, your Mac or the storage device might need service. Shut down your Mac and unplug all nonessential devices, then try again. For an external storage device, check its cable, connections, and power as well.