In an interview with BET, the president described his conversation with a group of young civil rights activists, including a leader of protests in Ferguson, Missouri, he hosted last week in the Oval Office.
Obama said he told them that "this is something that is deeply rooted in our society, it's deeply rooted in our history."
America has made gains, and that "gives us hope" of making more progress, he said.
"We can't equate what is happening now to what was happening 50 years ago," Obama said, "and if you talk to your parents, grandparents, uncles, they'll tell you that things are better, not good in some places, but better."
Obama said he is advising young people to be persistent because "typically progress is in steps, it's in increments."
In dealing with something "as deeply rooted as racism or bias in any society, you've got to have vigilance but you have to recognize that it's going to take some time and you just have to be steady so that you don't give up when you don't get all the way there," Obama said.
The full interview is set to air Monday night. A video excerpt was released Sunday.