“No offense, but…”

How are you supposed to learn how to not be “unintentionally” racist or sexist or whatever if people never have the right to tell you that you hurt them?