This will happen at some point in your teaching experience if it hasn’t happened already. It can be helpful to let students know that strong emotions might be a part of conversations that emerge and that these emotions should be acknowledged and worked through. Avoid shaming as this could cause the student to dig deeper into their own biases. Questions will generally go farther than accusations. “What do you mean by that?” “Is there someone who might be hurt to hear you say this?” “Is there a different way that you could say this?” “Where do you think this idea came from?” “What are the implications of this idea?” Sometimes other students will engage in these discussions too, and there can be a positive shift in ideas that comes from interactions with fellow classmates.
Many times a student who doesn’t realize their biases will appreciate the chance to rethink their phrasing and it can be a learning opportunity about how attitudes form (and can also be unformed). If the student does not change their response, it can be useful to pull the student aside after class and talk one-on-one rather than calling them out in front of their peers.