Well, first of all, to at least some degree, OOC is in the eye of the person writing/reading. I’m not a fan of picking on people’s writing, and if someone tells you that your writing is OOC in a non-helpfully-constructive way, please do me a favor and kindly tell them to shut the fuck up.
But! If it’s your own writing your worried about, my best tip is to just think about the character a lot. Seriously. That’s how I do it. When I’m planning to write for someone I’m not used to, I read their wiki page, check out other people’s fic, and do a whole lot of thinking/daydreaming about the character and how they would behave in the situation I plan to put them in. Just giving your idea time to settle properly can make a huge difference, so my advice would be to take it slow, and really get a feel for who you’re writing.
My other advice, though, is to not be afraid to do things your way. The main rule I always follow is that “it’s only canon if I like it”, and honestly, I’m way happier writing that way.
Fanfiction is a world of possibility, and a lot is possible if you’re willing to work a character into a situation. Take Sub Au for example. It’s… really out of character for the canon DL boys, but it works because I’ve written the characters into a place where it’s feasible. And it really works because I love what I’m writing, and I’m inspired to make it good.
So! Final advice is to have fun and try not to worry too much. Get into your character’s head, but don’t get so caught up in making them IC that you lose the fun part of writing. You can write whatever you want. No one is obligated to like it, but if you had a good time making it, it’s good fic.
Also, no idea how many people are interested, but I’m always up to giving writing advice!! 😀 Questions like this will literally never bother me.