Remembering the “trim” command: “Spaceman scans for free blocks and trims APFS containers when they’re mounted.”

Link. I wouldn’t touch it. Modern Thunderbolt APFS SSDs are very complex.