Stereotype threat occurs when we fear our actions will confirm negative stereotypes about our “group.” When activated, stereotype threat harms performance and motivation by reducing feelings of competence, belonging, and trust. Note that stereotype threat can affect the performance of anyone in a situation where a stereotype-based expectation of poor performance is evoked. It can be mitigated by reframing tasks to remove associations with stereotypes, by giving effective encouragement, and with self-affirmations.
Some suggestions
High standards + encouragement works. You can help mitigate stereotype threat by providing effective feedback that also lets the student know that you are expecting high performance from them, e.g., “Most students struggle with this. It’s difficult! But I am certain you can do it.”
Provide role models. Use examples of well-known computer scientists in your class that are diverse--women, minorities--without necessarily commenting on their gender or race.
No stereotypes are good stereotypes. Even positive stereotypes can have negative effects. Be mindful of impact. Comments that point out the positive characteristics of a stereotyped group can, in some situations, trigger stereotype threat. They may also divide between students.
Be careful with humor. Humor can build social connection but it can also divide. When using anecdotes or asides be wary of relying on stereotypes. Not all humor is helpful -- or funny.