Try to mount the SD card manually in Disk Utility and then format it again. If your fail to format the SD card, perhaps it is write-protected, then you need to remove the write protection so that you can do further operations on it.
The inserted SD card on Mac should be automatically mounted, but sometimes it is not properly mounted due to various reasons. You can simply unplug and reconnect the SD card to your Mac, if it doesn't work, manually mount the SD card with Disk Utility: select the SD card on the left sidebar and click the Mount button at the toolbar.
If the SD card is still not mounting on Mac, try the methods such as checking the connections, restarting your Mac, updating macOS, repairing the SD card with First Aid, etc.
After successfully mounting the SD card on Mac, you can try to format it again via Disk Utility. If you fail to format the SD card on Mac, the culprit could be the write protection on the SD card, it prevents unauthorized write operations on the SD card to protect data, so you can't delete files from it and format it.
Thus, you need to remove write protection from the SD card with this link and then continue formatting it.
If any important data is lost or unbacked up during the process, try iBoysoft Data Recovery to retrieve it!