You can play whoever you want. Have at it. The only thing would be avoiding stereotypes. I've seen guys writing females that have hit every type of stereotype in the book. I have also seen girls do the same thing. So, you can write who you want just do some research. The same thing with doing characters of a different race or ethnicity. Do. Your. Research. Don't be lazy about it either. I myself am a Person of color as they say. There's nothing worse than seeing characters like myself be made to as a walking talking caricature when a bit of research could go a long way. Or the focus of said character is just their skin color. It's annoying.