For example, I might see several instances of individual cyclists running red lights and generalise that to "all cyclists run red lights". Or see several instances of individual motorists "dooring" cyclists and generalise that to "all motorists are dangerously inconsiderate".
It's probably easy to go from that generalisation to an overt dislike of the other group. Therefore, I try to force myself to attribute bad behaviour to the individual rather than any groups they might be a member of.