This may also happen at some point during your teaching career. If you anticipate a student who may fall into this category, it can help to talk with them in advance.
It may also help to distinguish between a student who is presenting a conflict that can be mitigated by thoughtful discussion and a student who is intent on resisting regardless of whether facts and logic are on their side.
Building strong relationships with students is vital to understanding your students and to anticipating and possibly even preventing conflicts before they happen.
Giving students written opportunities to respond to reflection and discussion questions can be a way for a resisting student to express themselves without involving the entire class. (It also gives you the teacher written documentation if you need to pursue action.)
Ultimately, though, you need to be aware of your school’s policies on hate speech, and if a student insists on racist or disrespectful language, bring administrators into the situation and seek guidance on next steps.