Since you didn't mention which device you are using, here, we'll take the Windows PC as an example. You can initialize and format a new SD card, check the hardware connection, update or reinstall the SD card driver, assign a new SD card drive letter, and repair a corrupted SD card to solve the SD card not detecting issue. Last, you can consider formatting the card.
Initialize and create a partition for a new SD card. You should go to Disk Management > right-click on the unknown SD card > Initialize Disk. Then you should create a new volume for the SD card, including choosing the desired file system, setting a volume size, and assigning a drive letter.
Update or reinstall the SD card driver from Control Panel > System > Device Manager. Expand Disk drives to find your SD card. right-click on it and choose Update driver > Search automatically for updated driver software.
Assign a new drive letter from Disk Management > right-click on your SD card > select Change Drive Letter and Paths. Follow the onscreen wizards to finish the process.
Run CHKDSK /F or CHKDSK /R command to repair a corrupted SD card. If the SD card is still not visible in Windows File Explorer or appears in Disk Management as RAW, the SD card's file system is likely corrupted. In this case, you can run CHKDSK command to repair a corrupted SD card.
Run SD card recovery and format your SD card. If the CHKDSK command fails to repair your memory card, you can consider formatting it to obtain a working SD card. However, before formatting, you should use iBoysoft Data Recovery to recover files from corrupted SD card.
After that, you can proceed with formatting the SD card on Windows.
For Mac users, you can also fix the SD card not recognizing on Mac with many effective solutions.