Great Greedy Guts
Ceterum censeo Vigilam esse delendam.
As a male writer, I would like to know the best way to write gay or lesbian characters.
To second Hexxart, yeah, don't feel like you need to write about parts you don't feel qualified to write about, even/especially if you do the research and still feel that way. Not every story with/about queer characters has to be about the totality of queer existence, or focused on any given character's queerness as a deep exploration of, like, what it means on some fundamental level or anything. Nothing wrong with those kinds of stories, but one frustration I know has been mentioned in the thread before is how sometimes it feels like that's the only "valid" queer story out there.
Though there's also a weird line with what I think of as "incidentally queer" characters, where it can be either great or awful depending on juuust how incidental they are. Dumbledore's a great example, I think. Rowling's claim definitely holds up and makes sense, and I know people who picked up the subtext pretty heavily... but it's so incidental (not even being explicitly mentioned) that any attempts to claim it as representation seem hollow and frustrating at best. But a few lines, here and there, highlighting his relationship with Grindlewald a bit more? Would've been easy to have Harry miss things if it mattered while still making his sexuality pretty explicit.
And then again it's also hard for some to know how to handle incidental trans characters, because if they aren't major their trans-ness might not matter enough to the plot to make sense bringing up, but both making it clear and leaving it unsaid come with their own trouble. I kind of like the way it's handled with Ms. Hudson in Elementary, but I know other folks who don't. Not what you asked about, specifically, but related.
But thank you for asking, because if nothing else thinking about how to do something is generally better than just... not doing the thing at all.
Oh! Uh, I assume you've read the thread, but even so it's worth repeating: be careful of presenting lesbian romance as somehow more pure or innocent or "untainted" or whatever. People do that, and it's kiiinda creepy and treats women in a relationship more like children to fawn over than actual adults in a relationship.
Secret protip: include an explicitly bi character and the bi folks who read the book will probably be intensely happy, my partner and I always notice when a show uses (or avoids using) the term.
(That last one is mostly a joke, but not completely. It's getting to be less of a thing, but...)