I hope this isn't arrogant
but a lot of the comments I get on my fics wind up being about how well I characterize and keep the players in character so I wanted to share a few tips & thoughts about it in case it helps anyone with their own fics!!!

But before I start - the beauty of fanfic is that we aren't necessarily obligated to keep characters IC ! Fanfic is always "what if" and that's part of the fun! So if that's your approach to a story, knock yourself out and have fun! I'm here to talk about when you WANT them IC.
So for me, basically when I approach a character I'm Frankensteining canon stuff I know about them + my own personal experience + my ideas that are specific to this fic/plotline/AU/whatever. And all these various inputs can really dilute the original character, right?
It's really easy to stray from the original point when you're in the zone and writing and it's really easy to tip the balance and accidentally stray from IC stuff by adding too much of your personal stuff.
That's how we wind up with so much fic where the characters become OOC because they're basically cardboard self-inserts of the author. And again, that's fine! You do you. For me, it's really easy to get distracted and stray from my ideas or my feeling for the characters.
What I like to do is sort of have a few different inspiration pieces that I can revisit when I need to refresh my idea of the character and circle back to how they "should" be. Sometimes I need to literally do this in the middle of writing,
so it doesn't really help to watch an episode of something or read a long passage in a book. Instead it helps if I can think of a teeny canon exchange, or a picture--even a fanart!!!--that I can look at to just bring me back down to earth and return to who I think this person is.
This could even help if you're working on one of those situations where you don't necessarily want the character to be canon IC-like try to narrow what gave you the idea down into something you can reference quickly, something that inspires you and brings you right back in.
ALSO if your source material does not use live action humans, I find it SO helpful to look up photos of real people that I think the characters might look like. Not everyone needs to do this, but for me it REALLY helps to humanize if the characters are animated or from books.
If there are VAs I also sometimes like to look up interviews (if their normal voice sounds enough like the character) and I'll space out and not even hear what they're saying, just acclimate myself to the cadence and pitch of their voice so that I can draw on it in my own mind.
When I was writing a lot of fic for a book series I also used to try to find people whose voices I could image being the characters and I'd do the same. Just space out and listen to the pitch of their voice.
If the character speaks a different language I'd also look up random videos of the language and listen with no idea what they were saying LOL. Like I used to write about a guy who spoke Latin and I'd listen to Latin just try to make my idea of him as full and real as possible.
Also personally in my own creative process, I'm really inspired by music. All my fics are based on songs. So I'll put the original song on that gave me the idea and take a minute to reconnect with how I felt when the idea came to me.
Another thing I want to mention, which is more about writing in general but HEY MAN GOOD WRITING HELPS GOOD FANFIC RIGHT? is that you always want to know how your characters feel, even if you never reveal it on the page.
So with keeping players in character in a scene it really helps if YOU know how they feel and what their motivations are. This is rly important for the non-POV characters. Just because you aren't saying it doesn't mean you shouldn't know, as the author, what they're thinking.
Sometimes I will write overviews of these things down on a sticky or something or in the margin for myself so that I can stay focused. "character b is acting this way because they are lonely". So imagine you're writing a long dialogue or something, it's easy to stray from the -
point when you hit the rhythm of the dialogue and really get in the zone, and it's helpful to occasionally draw back and remind yourself "character b is lonely" to make sure that their motivations haven't strayed along with your attention span.
I'm probably going to QRT this with some fandom-specific examples but I wanted to just say those few things in a more general way.
I've been writing fic for 20 years LMAO and while traditional writing advice is always applicable, there's certain things about fanfic that make the experience different and unique.
When I started writing fic I was a teenage girl writing the POV of grown ass adult men and as a result I was characterizing all of these adult men as teenage girls who would cry over having fights with their friends LOL.
I like to think I grew out of it and I've learned from those times and I can now cherrypick which of my own traits and experiences are relevant to bring to a fanfic. Part of the fun of fanfic is self-inserting anyway, so I'm not saying not to do it. I do it CONSTANTLY.
But it's sort of a matter of translating my own bullshit into being appropriate for the characters and the universe. Personal touches are what make fic amazing and as a reader I am always SO happy when characters come across as genuine and rich and really human.
(I mean, caveat, maybe they aren't human LOL but I suppose I'm saying they should feel rich and real and if they AREN'T human again I will suggest having inspiration pieces to bring you back to how they should operate.)
So it's really easy to get carried away in the moment and stray from your point and insert more and more of yourself in a character until they're basically unrecognizable and so I suggest creating a solid scaffolding of inspirational material (pictures, music, voices) that you -
can always fall back on to reel yourself back in. Check in with yourself and your characters throughout your work and ask if you're on the right track with your original concept.