we as authors have been writing about people we aren't for forever. We find a way to empathise, we find a way in. Female characters are no different. All they are are characters. They are people too. Instead of asking yourself, "How do I write this female soldier?" ask yourself, "How do I write this soldier? Where is she from, how was she raised, does she have a sense of humour? Is she big and tall, is she short and petite? How does her size affect her ability to fight? What is her favourite weapon, her least favourite? Why? Is she more logical than emotional? The other way around? Was she an only child and spoiled, was she the eldest of six siblings and a surrogate mother? How does that upbringing affect how she interacts with her team? etc etc and so forth." Notice how the first question gets you some kind of broad, generalised answer, likely resulting in a stereotype, and how the second version asks lots and lots of smaller questions with the goal of creating someone well rounded.One would hope, really, that we as authors ask such detailed questions of all our characters, regardless of gender.So let me, at long last, actually answer the original question:"How do I write a female character?"Write her the way you would write any other character. Give her dimension, give her strength but please also don't forget to give her weaknesses (for a totally strong nothing can beat her kind of girl is not a person, she's again a type - the polar opposite yet exactly the same as the damsel in distress).Create a person.
Go into yourself. Find out the reason that commands you to write; see whether it has spread its roots into the very depths of your heart; confess to yourself whether you would have to die if you were forbidden to write. This most of all: ask yourself in the most silent hour of your night: must I write? Dig into yourself for a deep answer. And if this answer rings out in assent, if you meet this solemn question with a strong, simple “I must,” then build your life in accordance with this necessity; your whole life, even into its humblest and most indifferent hour, must become a sign and witness to this impulse. Then come close to Nature. Then, as if no one had ever tried before, try to say what you see and feel and love and lose......Describe your sorrows and desires, the thoughts that pass through your mind and your belief in some kind of beauty - describe all these with heartfelt, silent, humble sincerity and, when you express yourself, use the Things around you, the images from your dreams, and the objects that you remember. If your everyday life seems poor, don’t blame it; blame yourself; admit to yourself that you are not enough of a poet to call forth its riches; because for the creator there is not poverty and no poor, indifferent place. And even if you found yourself in some prison, whose walls let in none of the world’s sounds – wouldn’t you still have your childhood, that jewel beyond all price, that treasure house of memories? Turn your attentions to it. Try to raise up the sunken feelings of this enormous past; your personality will grow stronger, your solitude will expand and become a place where you can live in the twilight, where the noise of other people passes by, far in the distance. - And if out of this turning-within, out of this immersion in your own world, poems come, then you will not think of asking anyone whether they are good or not. Nor will you try to interest magazines in these works: for you will see them as your dear natural possession, a piece of your life, a voice from it. A work of art is good if it has arisen out of necessity. That is the only way one can judge it.