As the United States erupts in protests and push back against systemic racism, parents are worried. Parents of Black kids navigate far more fundamental worries and much higher stakes, fearing that their children's lives will be taken for jogging, driving, even sleeping in their own homes.

Some parents of white kids, meanwhile, fear they'll raise children who will grow up to be racist -- if not the kind of racist who suffocates a man with a knee to the neck, then the kind who will quietly commit microaggressions.

How, they wonder, can we raise kids to be anti-racist?

The first step is understanding where racism comes from -- the underlying psychological and cognitive functions that lead us to see and categorize people by colour, according to May Ling Halim, associate professor of psychology at California State University, Long Beach, and Sarah Gaither, assistant professor psychology and neuroscience at Duke University.

Babies as young as three months can distinguish faces by colour, and 3-year-olds are fully capable of understanding racial categories, and even the hierarchies that come with them. The trick is to accept that this categorization is normal, and to keep it from mutating into racism.

Halim and Gaither study race, gender, identity development, stereotyping and social perceptions. In collaboration with Kristina Olson at Princeton, Yarrow Dunham at Yale and Kristin Pauker at the University of Hawaii, they are embarking on a National Science Foundation-funded study, looking at the racial and gender biases in children of many racial groups across five geographical regions to learn how culture influences bias.

I asked Halim and Gaither how children form racist attitudes and what parents can do to keep them from becoming racist.

CNN: Why do children favor people who look like them or are like them in other ways?

Sarah Gaither: In-group bias, sometimes called in-group favoritism or in-group preference, means someone favoring people who look like them or are like them in other ways: in-group versus out-group preferences. This can manifest anywhere from in our attitudes, how positively we feel about them, to an allocation of resources or to the characteristics and stereotypes children are learning.

They attribute positive characteristics to their in-group and negative characteristics to an outgroup. And this is always in reference to another group. No one can have an in-group bias without having another group in mind; you need that comparison. And everyone belongs to some groups -- race, ethnicity, gender, sexual orientation, age, socioeconomic status, occupation, college affiliation, religion, neighborhood, even your favorite sports team.

May Ling Halim: One way we measure this behavior with kids as early as preschool is we give them stickers or erasers and say, "Who do you want to give this eraser or sticker to, this Black child or this white child?" Depending on who they give more erasers or stickers to, this suggests a social preference for that group. We also measure this by asking kids who they would rather share their book with or eat lunch with and give them choices of different kids from different racial backgrounds.

CNN: Why do children form these groups, and why do they form preferences about their groups?

Gaither: We learn through categorizing. Any child, as they're growing up, is learning language through putting similar sounds together. That's also a form of categorization and it's how we learn to speak our native languages. The same thing is happening when we see different social categories, social kinds and objects; we start seeing similarities and differences and forming perceptual groups.

Halim: It's partly reflective of cognitive development. We need to categorize people and objects, chunk them because it's easier. It doesn't overload our brains as much to be able to put things in groups instead of seeing everyone as an individual.

Kids are more likely to categorize people based on their physical characteristics, so it makes sense that they group kids by race and gender, which are distinctions that are often, but not always, easy to see.

CNN: How does recognizing differences between groups become racism?

Halim: From when we're young, we're grouping things and knowing where we belong in these groups, but we also have this motivation for self-esteem; we want to feel good about ourselves and about the group we belong to. If your group is better than another group, you feel better.

This was an idea called "social identity theory" from Henri Tajfel, a Polish Jewish immigrant in Europe trying to make sense of World War II. This theory argues that our sense of self is entirely based on our group memberships -- this notion of "them" versus "us" -- which creates a sense of belonging to our social world.

A distinction is ingroup favoritism versus outgroup negativity or derogation. Much of the psychological literature suggests that most young children are biased in terms of preferring their own group, but most don't usually show outright hostility to other groups.

Gaither: I don't think anyone's kid is born racist. Children are born into a world that has systemic racism, and they're born into a culture that harbors racists attitudes and racist ideologies and those ideologies seep into everything. If someone is harboring certain racist attitudes, it's something that they are learning from their parents, schools, the media and the culture.

There's your personal bias, and there's this larger bias known as institutional racism, which is embedded in our society; in our social and political institutions that continue the disparities that we see in the criminal justice system; in the health system; in the educational system.

Because institutional racism is so ingrained and so automatic and so accepted, without enough people wanting to enact true, long-lasting change, institutional racism ends up becoming our personal bias. But we still must be held accountable for our actions.

CNN: How do we prevent our children from becoming racists?

Gaither: First, by talking about race.

We don't have enough experience or practice talking about things that have been constructed to be scary such as race and gender. These are not things that we normally talk about. Work has suggested that a lot of white parents take colourblind approaches when talking about race, so when their child does encounter someone from another racial background, that parent isn't going to feel prepared enough to actually have that discussion appropriately with their child about race.

We should not be endorsing a colourblind ideology in any way, shape or form. We should be acknowledging what race and ethnicity are in our country. We should be acknowledging the historical lineages that come with being members of different ethnic and racial backgrounds.

But that's not enough. Some work suggests that if you just label someone as being Black or Asian or LatinX, without giving a context as to what those labels mean, kids can accidentally infer the wrong thing about a group. So when parents, teachers and kids do label different racial and ethnic groups, they need to do so in a way that they're teaching awareness of what that group is in positive ways.

What you can deconstruct are those automatic, implicit, instantaneous and often negative associations with racial groups that are different than our own. So, stereotypes such as African Americans being academically inferior compared to any other racial or ethnic group is something we have constructed in our society and something that now we know negatively affects student's performance on tests.

We need to deconstruct these stereotypes by teaching children and adults that we can reframe these negative narratives into positive affirmations. It's deconstructing the negative and being able to acknowledge all the beautiful difference that we actually have between our different racial and ethnic groups in our society.

CNN: How important are integrated friend groups and non-verbal cues?

Gaither: Parents need to have friends of different races and ethnicities. There's research with children showing that the racial makeup of a parent's friend network is much more telling of the types of racial attitudes that kids will end up having. If you have a completely racially homogeneous set of friends, all white for example, that child is going to be less likely to have a more open view of what race is.

They also need to be aware of their non-verbal behaviors -- the body language we show in different contexts, often without knowing it. Regarding race, a common example often used for this concept is a white person crossing the street when a Black individual is walking toward them. Very young kids are learning actively from these non-verbal cues. Although there is little research on this with children, that's another direction we need to be studying a lot more in how prejudice forms in young children.

Halim: The classic example that is easiest for people to think of is when you see someone you feel uncomfortable around maybe you clutch your purse much tighter because you're worried they might steal it from you.

It's something that I don't think adults often think about impacting a child, but the child will see that behavior and then associate that behavior whenever they see someone who looks similar. Those non-verbal cues are very telling to kids about what their parents think about race, and their parents are their trusted informational source.

CNN: What internal changes do white people need to make to keep that from happening?

Gaither: It's not an overnight change. Talking about race is really difficult, no matter what your ethnic or racial background is. The average cross-race interaction doesn't go very well usually because there are increased anxieties on both sides of this conversation. Everyone is expecting someone to say something wrong.

We all have internal biases whether it's about race, gender, disability, etc. But we also all can distinguish between what's known in psychology as "controlled thinking" versus "automatic thinking."

The automatic thinking is going to be that implicit stereotype that you would apply to a child who breaks your fine china, for instance. Your automatic thinking would be: "That child is always a brat. That child is so ungrateful." You go to this instantaneous response when someone does something you don't like.

But if you take a little more time to use your controlled thinking, you make an intentional effort not to discriminate against that kid, and instead you think, well maybe it's because I've ignored my child the last five hours. Maybe there's something else in the context or surroundings that actually ended up causing the child to do that behavior.

I talk in my classes about internal versus external dispositions or explanations of why someone does something. For example: kneeling for the national anthem. You could look at those kneeling and say, "Well they're just people who don't care about America. They're people who don't care about our rules and guidelines. They're just troublemakers."

But if you use your controlled thinking and look at the larger context, you then see the systemic forms of discrimination and prejudice that these individuals have faced across their lifetimes. It's that context that actually caused that behavior, not the disposition or the stereotype application.

Halim: Acknowledging that you have these associations doesn't mean you're a racist, but you're exposed to all these stereotypes around you in your environment. There's an explanation for why you might have these associations. This can help people acknowledge that they have these biases and feel more comfortable talking about it.

What about people from other racial groups? Can they have biases?

Halim: I think it's also important to remember that other racial groups can have biases as well. Asian and Latinx people can also have anti-Black biases.

If we belong to other stigmatized groups, it could also be helpful to think about the experiences with discrimination that we have had as well to better relate to other groups' experiences with discrimination. I think a lot of people have been doing this, which is why we are seeing protestors of all colours in the streets.

CNN: How can people, especially white people, acknowledge their own biases and change?

Gaither: The first is assess your own comfort level. If you jump right into this too far, you're most likely going to say the wrong thing or do the wrong thing. Baby steps is a good first encounter.

The second thing is, we need to start finding comfort in discomfort. It's okay to feel slightly uncomfortable having these discussions, but what I tell people is, the more you have these discussions the less discomfort you're eventually going to feel. The first few conversations are going to be extra difficult. You need to get through them to get to the easier ones later on.

You need to be vulnerable. Avoiding these conversations is just going to make that discomfort more salient in every encounter you have. You also need to able to assess your own emotional responses when you hear things you've never heard before. Make sure you take care of yourself after that. It's going to be cognitively depleting -- your brain is literally going to feel tired.

You need to find ways to recharge so you have enough positive energy going into conversation number two.

Parents and educators play a critical role in helping children of all ages navigate current events and talk openly about the historical roots of the various 'isms in our country. Learning how to talk about things like police brutality and white privilege takes a lot of practice, patience, and skill, regardless of who we are -- but it's key to dismantling racism.

We need to listen to each other, learn from each other, and with time, these conversations will get easier while also becoming more impactful for society.