Discrimination is a general term that is defined as preferential or prejudicial treatment of people based on race, gender, age, color, sexual orientation, and several other categories.
Racism is is a sub category of discrimination that is a practice of prejudicial treatment of people of other races, groups, communities etc because of feelings of superiority of one’s own race and culture.
For example:
(1) The boss does not like to hire anyone over the age of 50 since their near retirement age. (The boss is practicing age discrimination.)
(2) Black people are only good at sports. (That is a racist statement)
Hope that helps!