I’ve found it really useful in my writing to just get in the habit of doing the thought experiment of gender-flipping basically every character before settling for sure on their gender. I just ask myself with every character: would the story be different if I gender-flipped this character? How? Would it still work? What would need changing? And then, finally, which way is more interesting?
It can also be really enlightening to actually perform the experiment of gender-flipping the main character in a story you’ve already written and see how it plays out. When I’ve done that, it’s been really interesting to see what subtle things need changing. If the main character in a story is gender-flipped — do pronouns become unclear in some scenes? Do the behaviors of any characters suddenly read differently? Possibly more flirty or aggressive? It’s a fascinating exercise to perform and can inform your writing for long after.
Please note, experiments like this are, of course, also possible outside the gender binary.