Strictly speaking, this is impossible (you cannot create something that nobody else can delete), although you can make it unlikely that somebody would find the file. SD cards, like most "block storage devices", can be partitioned; split into multiple parts, each of which show up as their own "storage volume" (and, on Windows, typically each get their own drive letter). Each partition is (usually) formatted separately, so if your thief only formats one partition, they won't get data stored elsewhere in the device. In fact, you don't really format a disk or SD card, you format a volume, which is usually a single partition and (on removable media) often the only partition, but doesn't have to be.
If you shrink the default (single) partition of your SD card just slightly, you can create space at the end of the device that will not be touched by reformatting the (visible) partition. You can then:
- Leave that space un-partitioned, but optionally put some data there anyhow. This is somewhat tricky to do, especially on Windows, but it can be done.
- Create a partition there and leave it unformatted, but optionally put some data in it anyhow. This is also somewhat tricky and mostly the same as the previous option.
- Create a partition and format it, but with some format Windows doesn't know how to read. This is slightly more likely to fail - with the right driver installed, Windows can read anything, and it will mount any volume it can read as a drive letter that a thief would readily see - and is of course hard to do from within Windows (but what says your thief uses Windows anyhow?).
- Create a partition, format it with a Windows-readable file system, and mark it as a partition type that Windows does not normally assign a drive letter to and/or set a flag telling Windows not to give it a drive letter. This can technically be done with out-of-the-box Windows tools, but may require converting the SD card from "MBR" format (old but very widely supported) to "GPT" format (newer and with lots of new features, but stuff like cameras and whatnot may not be able to use it).
I should stress that none of this is SECURITY at all; you're just hoping the thief doesn't bother to look. There is no way to actually secure an SD card such that you can use it but nobody else can. (SD cards do support password locking, but most OSes can't set the password or work with password-locked cards, and an attacker who knows how can reset the password anyhow, destroying all data on the card but making it available for any use.)