Don't directly reformat the SD card when it is unreadable and unmountable, reformatting will delete all the contents. You can repair the SD card with the command or disk management tool on your computer, recover data from unreadable and unmountable SD card with third-party data recovery software, and then reformat the SD card as the last resort to make it usable again.
Various reasons could make your SD card unreadable such as a corrupted SD card reader, damages USB port, internal file system errors, virus infection, etc. As you said, the SD card and all its contents became unreadable and unmountable after coming back from sleep or rebooting, it seems that the SD card is corrupted.
To repair a corrupted SD card or unmountable SD card, you can run the fsck command on macOS, or chkdks on Windows. Both commands are used to check and repair logical errors on your hard drive. In addition, macOS' built-in Disk Utility features First Aid which can repair the detected minor errors in the disk formatting and directory structure.
In case the above methods fail to fix unreadable and unmountable SD cards, you should recover data from the SD card and then reformat the SD card to fix the issue. Professional data recovery software such as iBoysoft Data Recovery could be a good choice to perform SD card recovery. Free download to scan and recover data from SD card now! Then you can proceed to format the SD card without losing data.