From the basic rules in the new edition of Dungeons and Dragons:
You can play a male or female character without gaining any special benefits or hindrances. Think about how your character does or does not conform to the broader culture’s expectations of sex, gender, and sexual behavior. For example, a male drow cleric defies the traditional gender divisions of drow society, which could be a reason for your character to leave that society and come to the surface.
You don’t need to be confined to binary notions of sex and gender. The elf god Corellon Larethian is often seen as androgynous or hermaphroditic, for example, and some elves in the multiverse are made in Corellon’s image. You could also play a female character who presents herself as a man, a man who feels trapped in a female body, or a bearded female dwarf who hates being mistaken for a male. Likewise, your character’s sexual orientation is for you to decide.
Therapeutic role-play rarely mixes well with gaming, and SJWs are no fun at (or in) a party.
Update: how would I write this, to get the point across without bullshit gender-studies jargon and really stupid examples? (note that I’ve added back the first and last sentences, above. I originally left the first one out because it was the only sensible part, but then I read multiple complaints that it was still too “binary”; I added the last sentence just for completeness)
There are no sex-based restrictions or penalties in D&D; you are free to create your characters as you imagine them, and role-play your choices.