Launch the Terminal app from the Utility menu on the menubar. Issue the following command to get the device identifier for the physical internal SSD:
diskutil list internal physical
Usually the device identifier will be "disk0", but if the internal SSD is faulty, then it could be some other identifier.
Once you have the correct device identifier for the internal physical Apple SSD, you will use the following command to write zeroes to the beginning of the SSD to destroy the partition table. I'm using the device identifier "disk0" here, but if your SSD is using a different identifier, then replace "disk0" in the commands with the correct device identifier for your SSD. It is best if you disconnect all other external devices from the computer so that you do not accidentally erase the wrong drive. There are no safety nets when using the command line.
Make sure all volumes are unmounted on the drive you wish to erase by using the following command (example here is for the drive associated with device identifier "disk0"):
diskutil unmountDisk disk0
Write zeroes to the beginning of the drive associated with device identifier "disk0":
dd if=/dev/zero of=/dev/disk0 bs=100m count=10
If these command complete successfully, then you can quit the Terminal app and relaunch the Disk Utility app. Select the physical SSD and erase it as GUID partition and APFS (top option). You may need to click "View" within Disk Utility and select "Show All Devices" before the physical drives appear on the left pane of Disk Utility.