A lot of writing guides and other writers will tell you that you should decide who your character is before you sit down to write. That's good advice, but when it comes down to it, the way to really get to know your characters is the same way a reader will get to know them: by what they say or do on the page.
After I’ve done research on my subject and brainstormed on it, I sit down and write scene, starting with just dialogue, action and beats. Instead of writing exposition, where I tell the characters what they’re up to, I let go of the reins and allow my characters to tell me who they are by how they interact with other characters and how they respond to the situation I throw them into.
Apprentice writers often think a reader needs to know a character before the story can get underway. We often stuff our openings with a character's history and flashbacks in an attempt to offer a psychological profile, say, or provide motivation. But we don't need to get to know a character all at once. In fact, I suggest it’s best that we don't. Imagine going out on a date with that person who won't stop talking about themselves. Yeah, that.
Instead, in that opening, and as we introduce a character, we generally want to get to know who that character is now, within their scene of conflict, rather than who that character was in the past. It may be very useful to build a character history for yourself and get to know your character that way. But you don't need to give it all to the reader. If you do, you may end up with a classic information dump, an exposition-heavy opening. We're back to the old show, don’t tell.
In short, you want to allow a character to grow over the course of the story, as much for yourself as for the reader. If you provide the character history and personality profile up front, you'll find that your character becomes defined by it. You may even run into the problem where the exposition or explanation you give about the character doesn’t match how the character actually acts. It's sort of like how people's social media profiles rarely reflect who they are in real life.
If, on the other hand, you allow your characters to reveal themselves to you, the author, in scenes of action and dialogue that you write, then you'll have a much more dynamic and rich character who evolves.