This article explains how to erase everything on an SD card, including instructions for Windows and macOS.
Delete SD and micro SD files using your computer.
The best way to wipe an SD card of all data is to format it. While the primary purpose of formatting a device is to change the file storage system, formatting also effectively erases the device.
Basic formatting removes the file system and replaces it with a new one. This is functionally the same as deleting all files, and it frees up the entire SD card for new files. Deeper formatting also randomly overwrites all data on the card. This option is safer because it prevents easy data recovery.
Both Windows and macOS have the functionality needed to erase an SD card without the need for any additional software. Furthermore, both options allow you to choose between a faster but less secure option and a slower but more secure option.