Sex in fiction is a touchy subject. There are as many different opinions on writing and and ways to write it as there are to have it. And that's totally okay. But I think there are some basics no matter how you do it. Write it, that is. I'm not stupid enough to presume to tell people how to have sex.
1. Learn the anatomy.
Nothing yanks me from a story faster than misuse of the word "vagina." A vagina is not the external sex characteristic. When a character incorrectly identifies his partner's anatomy in this most basic way, it calls everything into question. If he doesn't know where her vagina is, how am I supposed to believe he's going to please her?
2. Learn the slang for the anatomy.
Unless it's in-character, chances are your character isn't going to think "vagina." S/he might think "penis" but "vagina" is the sort of word that, for some reason, makes people squeamish. There's a wealth of resources for learning appropriate slang out there. (I like this one.) Find those resources and use them.
Note: Vajayjay is not ever, not even a little bit, not even jokingly acceptable. Don't make me bitchslap you.
3. Mind your hands.
This happens frequently in fanfiction, but professional fiction certainly isn't immune: someone has three hands. Or the positioning just isn't physically possible, or someone left their shoes on but five minutes later--without any mention of having removed said shoes--toes are getting sucked. Just pay attention to your details. During editing, position yourself where you've got your characters. If you can't do it, they can't do it.
4. Nothing tastes like peaches and cinnamon.
Several years ago, this was a big problem in fandom, particularly in the Harry Potter fandom. It stemmed, mostly, from people who were not old enough to have even really experienced their own bodies writing terrible smut. Again, professional fiction is not immune. Something might taste almost pleasant or have a hint of flavor of the food the character has been eating, but nothing coming out of the lower regions is going to taste like peaches or cinnamon or cherries. Don't sugar-coat it. (However, you can have your characters actually sugar coat it. Flavored lubricant is pretty nifty.)
5. The big O.
Fact: up to 75% of women do not orgasm during intercourse. If your heroine were in the real world, she probably wouldn't reach that peak. It's okay to have her do it, anyway, because fiction is fantasy. But it's okay if she doesn't, too. Sex isn't always just about the orgasm and if your character is a "journey is half the fun" type, it's completely okay for her to miss that climax. Men don't always achieve orgasm, either. Sometimes, they even fake it. If you're writing sex as part of a larger story (and not, like me and other porn writers, writing it because it is the story), then it adds a touch of unusual realism to have your character skip the big O... and who knows, you might make readers for life for that little detail.
6. You have five senses, use them.
Sex is about more than touch. It's sight, smell, sound, and taste. Just keep that in mind when your characters are getting hot and heavy. Of course they're not going to notice everything--nobody does--but showing us what they do notice, and what they savor, is going to tell us a lot about them.
7. Don't sacrifice character.
Out-of-character sex is just as bad as any other out-of-character behavior. If a hero of few words is suddenly spewing erotic terms of endearment, or a shy, repressed virgin turns into a wanton woman the second the hero drops his pants, I am going to call bullshit, roll my eyes, and close the book. Make me believe it, damn it.
8. There's nothing wrong with porn.
Written porn, at least, hurts no one. Oh, it might upset some people, and it might make others uncomfortable, but written porn for the sake of porn is--in my world--perfectly acceptable. If you want to write sex not because it's part of a larger story or because it shows or tells something, if you want to write sex simply because you want to do it, then do it. It's okay.
9. If you don't think it's hot, your reader won't think it's hot.
This maybe should be my number one tip. It's the one thing I preach whenever asked about it. Write what you think is hot because if you're not enjoying it, that shows in your words, and you ruin things for your character and the reader. You really don't want that.
Bonus Thing: The rules for writing sex, like any writing rules, can be broken. Just not until you learn them.
But I really will come bitchslap you if you use "vajayjay."