Knowing who your character is and what motivates them is key! In a class I've taught at TABC we talk about how nature and nurture have an impact on how a character behaves.
Nature refers to who they innately or naturally are, beyond all stereotypes or cultural expectations. Who they really are inside. This should manifest more and more as the character grows and strengthens.
Like, how the character Gryphon, in the series Nameless by Jennifer Jenkins, is kind and empathetic which was counter to his warlike, power hungry tribe. Or how Elizabeth Bennett is intelligent and savvy despite her socially awkward family and patriarchal culture. Some people are just going to have certain traits no matter what!
A great way to find out who your character is and what motivates them is to take the Color Code test as if you are your character.
Try it here: https://www.colorcode.com/about/
The basic results of the test will have your character fall into 4 categories. Red, Blue, Yellow and White. The colors represent what your characters primary motivations are, which can determine their behavior. Read in detail about what the colors mean and how they'll manifest in a person at the link above, but this is how it breaks down.
Red: motivated by power
Blue: motivated by intimacy
Yellow: motivated by fun
White: motivated by peace
Different traits go along with those motivations, so explore the Color Code results online. This can be a helpful tool if you are having trouble getting along with or understanding your character.
Unlike inner nature, nurture is how their outer environment has an effect on them. Their family, society, era they live in, schools they go to, etc. All of these impact how a character thinks and acts. Who would Harry Potter be without Hogwarts? Or Jo March without all of her sisters?
Take some time to decide and write down who your character is. Are they innately kind, combative, understanding, impatient, smart, creative, ambitious? Who are they inside?
Now think of their environment. What is it like? Is it a healthy and happy environment, violent, confusing, funny? Write down all you know about your characters backstory, their family, their culture, things that have happened to them.
Ponder...how would someone with the traits I outlined be affected by the environment I just plopped them into? Will it bring out their strengths or weaknesses? What will their pain be? What will their triumphs be?
Their internal struggle will move the plot.
Developing a good character is like making a new friend. Ask lots of questions about their nature and nurture. Explore your character's personality in terms of their natural self and their environment. It will help you know and understand them and how they may behave in any given scene that you put them in.
As your character learns and grows or even fails, they will change according to what they are made of and how those parts of self react to what happens to them. As the writer, you are the primary observer, just record what you see as it happens. It can be a fun and revelatory journey!