One of the hardest things to do as a writer is to write someone who is not yourself." - George R.R. Martin
Writing an authentic character of the opposite gender is notoriously difficult, though not impossible. George R.R. Martin is a male writer who has been widely acknowledged for successfully writing female characters. He suggests that in order to write a character of the opposite sex, the writer needs to start with the basics: we are all human - we are more like each other than we are unlike each other. Considering the ways in which we are the same to empathise with characters is a good place to start.
The main thing is empathy and saying ... 'How would I feel?' because the character is still a person." - George R.R. Martin
With this is mind, the following tips can help to create an authentic character written from either perspective.
Giving Your Character Depth
In any work of fiction, creating a round character that readers will love is critical to the success of the book. Why? At the risk of stating the obvious: If your character is poorly crafted it will be clear that even you do not know or understand them. Know their backstory, even if it's not included in the text itself, know how they feel on certain controversial issues, know their struggles - internal and otherwise... Giving your character greater depth will help you to understand them, regardless of their gender.
Kyra Bandte gives us tips on writing round characters here.
Choosing your Point of View
Consider the differences between first and third person narration. With unlimited access to their thoughts and feelings, readers are more likely to connect emotionally with a first person narrator. However, for this reason, creating an authentic character of the opposite gender may be quite a challenge in the first person. If you feel the challenge of writing from the opposite gender in first person is too difficult, third person narration is an arguably simpler option.
In a recent interview, Christine Howe told us how it became easier writing about her protagonist, Paul, by using third person point of view in Song in the Dark.
One of the best ways to gain access into the mind of the opposite gender is to read exemplars. Do your research - choose novels written from the perspective that you're interested in writing from. Make notes. Highlight sections where you think the character's gender shines through - what is it about these sections that make them inherently masculine or feminine? If you're going for something a little more complex, do your research here as well. There are many great examples of gender-issues in fiction, why not try reading something like Middlesex by Jeffrey Eugenides?
If you are searching for more traditional examples: The Hunger Games trilogy, by Suzanne Collins, The Other Hand, by Chris Cleave and My Brilliant Career, by Miles Franklin, are good examples of novels written from a female's perspective, while The Story of Tom Brennan, by J.C. Burke, Catcher in the Rye, by J.D. Salinger and The Great Gatsby, by F. Scott Fitzgerald, are written from a male perspective.
A useful option for gauging the authenticity of your character's voice is to complete a simple test on your readers. Offer your text to someone as you write. Make sure you don't tell them the gender of your character! Once they have finished reading, ask them if they could tell if the character was a male or a female. Was the voice authentic? Your reader will be able to give you immediate feedback on these questions and you can continue writing, adjusting your work accordingly. You may need to go back and edit the voice and background of your character.
Avoiding Stereotypes and Assumptions
It is best to avoid stereotyping or making assumptions about your character just because they are male or female. Not every teenage girl spends an hour in front of the mirror before school. Not every teenage boy smells like underarms and refuses to wash their excessively long hair. If you do give your character one of these traits, make sure that it is integral to the makeup of their personality.