One of my most controversial tips for sex writing is this: If you haven’t done it, seriously consider not writing it. I apply this mostly to BDSM, but it goes for regular sex as well. If you haven’t had sex, you might want to consider not writing sex scenes — and if you haven’t had a certain type of sex, you probably don’t want to include it in your books. You’re more likely to write scenes the way you’ve read them, instead of the way they actually feel, and then you’ll put your own twist on them, and they’ll get more unrealistic as you go.
But on the other hand, I know lots of writers (including myself) who write things from the other sex’s perspective, or write things they can’t possibly experience. I might be a man, but I’ve written plenty of scenes — sexy and otherwise — from a woman’s point of view, and occasionally from a trans or nonbinary person’s point of view. I can’t know what it feels like to receive cunnilingus; I don’t know what it’s like to have my ass fucked by a man (though I have been pegged more than a few times, so I can extrapolate).
As with any other type of writing, research is key. I don’t know what it’s like to be a Black teenager or a Korean-American teenager, but I wrote a whole book (under a different name) from those two points of view. How? Well, I wrote the story the way I wanted to tell it, and then I went out and found readers who have those experiences and ran the book by them. Sensitivity readers are important; even with erotica, you don’t want to offend your readers or make them feel like you’re not being genuine. I did something similar for my first-ever piece of M/M fiction (which later became part of the Four Days novella inside Butt Stuff); I wrote the story the way I wanted to tell it, and then I ran it by a gay man so he could tell me if the story and the sex made sense and was realistic. It wasn’t in one way — I made both characters’ penises well above average — so I fixed that in the editing process. I like to think Four Days is pretty accurately-written, given that it was written by a 1 or 2 on the Kinsey Scale (who, at the time, was a 0).
You can write from the point of view of a character who’s nothing like you. You just have to do the right research and have the right beta readers. But when it comes to BDSM specifically, if you haven’t done it, you probably at least want to try it first.
