There's a framework on the ingredients that go into genocides (look up ”8 stages of genocide” on google--stages is misleading, they're more like non-linear ingredients or elements) that I think from a general perspective can be helpful for navigating.
You may also want to look into dynamics for "othering" in sociology and see what can be constructed from there.
As an anthropological endeavor, the question I tend to ask is how do these patterns transcend culture/humanity (or it's lack thereof), and what are the factors behind it that shape how we exist as a species?
So from an evolutionary biology lens, what was the perceived or actual benefit of a behavior, and in what environments is it advantageous.
Then because we are dealing with real lives and people, the ethical questions must also be applied for discernment: how can we create a better path forward? how might we prevent unnecessary harms? etc.