Writing an erotic (or erotica) story is not too much different than a standard one. There are obvious differences, such sex and perhaps nudity, but both types of story involves creating a situation where the characters are under stress. One type of erotic story is the damsels in distress tale.
One thing nice about this type of writing is that it’s easy to have the stressful situation and usually the hero and villain are well defined. For example the famous damsel tied to railway tracks where the victim is at the mercy of the landlord until our hero steps in (Foiled again!). I think that idea originally came from the Perils of Pauline.
Regardless of how the damsel is put in danger, we can sure of a few things. One, she is pretty and vulnerable to the whims of the dastardly villain. Two, she is going to be tied up, usually with rope. Hopefully some of her clothes are removed or at least rearranged so that she is partly exposed. This may be more worrisome to her than the approaching train. Finally our hero, no doubt strong and handsome and has a knack for showing up at the last critical moment.
One story I wrote about damsels in distress was called Be Careful What You Wish For. In this case our poor damsel was dangling from a rope in a cave, where a dragon was eyeing her. Of course she was wearing a nightgown, suitably torn for the occasion. Will the good knight save her time? Ah, you’ll have to read the story to find out. Spoiler alert: he’s handsome and very good with his sword.