The words "discrimination" and "prejudice" have acquired negative connotations, but they are both reasonable and, indeed, inevitable in their place. All decisions involve discrimination. What matters is that the factors influencing the discrimination should be relevant. A hiring committee interviewing potential professors at a university will discriminate against applicants without doctorates, and those who have no publications. Since these are relevant factors for the job in question, no one will object to this discrimination.
Prejudice may also be reasonable. Criminal convictions are a good example of this. It would be impossible to gain employment as a teacher in most countries if you have a conviction for child abuse, and very difficult if you have any violence at all on your record. The prejudice that someone who has harmed children in the past is more likely to do so in the future is generally accepted as reasonable.
Sex and race are irrelevant factors in assessing a person's abilities and character. Sexism and racism refer to any consideration of these factors when deciding an issue. There are rare occasions on which sex and race might be relevant to a person's ability to do a job. One would not usually hire a white actor to play the role of Othello, or a male one to play Desdemona. However, in almost every case, racism and sexism refer to unjustified discrimination and unreasonable prejudice. These are not always easy to detect, since most people are ashamed to admit to being racist or sexist. However, a careful examination of the justification for any decision should reveal whether it is based on relevant factors, or whether racism and sexism have played a part.