This pair of words is a little more complicated than most here at HW, because half the time they aren't homophones at all. Desert has two distinct definitions and pronunciations, only one of which is pronounced like Dessert (de-ZURT). So, technically, we have three words here: two of which have the same spelling but different pronunciations (homographs), and a third that is a homophone of one of the homographs. Sheesh, sorry about that. Anyway, you can see that no matter which definition you intend, it's always a challenge making sure it's spelled correctly.
The trick I was taught to remember is that Dessert has two Ss instead of one because it's the only one you want MORE of. But this trick only holds up until you've eaten pumpkin pie, at which point the sentence "I wish I could desert this dessert in the desert" leaps to mind.