Within Disk Utility click "View" and select "Show All Devices" so that the physical drives appear on the left pane of Disk Utility. Select the physical drive for the SanDisk and erase it as GUID partition and MacOS Extended (Journaled). Your other options for file systems include APFS (top option), or exFAT. Which file system to use depends on how the drive will be used.
Try rebooting the Mac. Make sure to disconnect all other external devices in case one of them is causing a problem.
If this does not work, then boot into Safe Mode and to see if you can erase the drive. If this works, then you most likely have some third party software installed which is interfering with the normal operation of macOS. Typical culprits are anti-virus apps, cleaning/optimizer apps, third party security software, or possibly even the manufacturer's proprietary software/driver for the SanDisk drive.
What is the exact error message you are receiving? I have had issues erasing some external drives, but usually if I attempt another erase immediately after clearing the error message, the erase may succeed.