1 of 2

How does one incorporate trans/nonbinary characters without making their gender the main focus?

The same way you would any other character. Introduce them, and then... let the character develop.

For a trans character, this is heavily dependent on the stage that they're in - closeted, pre-transition, transitioning, post-transition - and what the environment is around them - are people transphobic? Is it just matter-of-fact in your story?

To make things simple, let's start off with the case of a post-transition trans woman, in a world where people aren't transphobic.

For all intents and purposes, just write her as you'd write a normal woman in your story. Don't make her talk differently, or act differently. Write her as you would a cis woman.
However, there are a few things you can do to make it clear that she's trans without making it her focus. For instance, make sure that she doesn't say anything about periods (assuming a transition level equivalent to modern technology). You could also mention something about hormones, just in passing, such as finally not taking hormone pills every day. There are lots of other ways, but these are a few examples.

If you want to write a transitioning trans woman, then this will... probably be made obvious by a physical description. Having her get misgendered and then correcting them would be a way to get it across. Mention upcoming surgery or something like that. Just in conversation, not as a focus.

These can be applied to trans male characters, too - such as mentioning him starting to grow a beard, top surgery, something about periods...

There are lots of ways to just stick it with subtle hints in passing, that aren't making it the focus of the character while still including positive representation.

Now, a really really easy way to include an enby character in your story is through pronouns. Just refer to this character as "they", consistently, and don't mention anything else. Make sure all of your characters use the correct pronoun.
If you're writing in a context where people are separated by gender, though, such as a locker room, that gets a bit trickier. If you're writing in a post-phobic environment, you can get around this by having different locker rooms and simply, normally, mentioning that they went to the other one.

Writing a genderfluid character is... tricky, if you don't want to make it a focus. I haven't ever tried writing a genderfluid character, but to do this you can probably use the pronoun trick. Switch up the pronouns, make sure that it's obvious that it's the same person, and describe different attire at different times - for instance, one day she'll be wearing a dress and the next he'll be wearing a basketball jersey.

Above all, make sure that all of these characters have depth and aren't token LGBTQ+ characters. Just as you shouldn't stick a token dark-skinned character into your story, make sure that you're not doing that with your non-cis characters.

Getting a sensitivity tester would be a great idea - there are plenty of folks in the LGBTQ+ community who'd be happy to read through it and give you feedback.

Make sure that you're treating your characters with respect, give them depth, and you should be fine.