First, check your SD card and ensure the write protection switch is not set to 'locked.' This physical lock will prevent writing to or formatting the card. You can also test the SD card in a camera or another Mac/Windows computer to see if it works there.
Next, check the file system format of your SD card. If it is formatted as NTFS, note that macOS can read NTFS drives but cannot write to them natively. To enable writing, you can use a third-party driver like iBoysoft NTFS for Mac to automatically mount your SD card and allow writing without the need to reformat it to exFAT, HFS, or APFS.
If you still want to reformat the SD card, try using Disk Utility again and ensure you format the card at the device level (not the volume level). If reformatting fails, connect the SD card to a Windows computer, copy all files to a safe location, and then run the 'clean all' command in DiskPart to erase your SD card. Afterward, you can reformat it to exFAT, which is fully supported on macOS.