I have some experiences of this from my undergrad. Once I had to deal with a teacher making very transphobic comments in class (lots of stuff about how trans women needed to have their clothes ripped off to reveal their "true gender") that were completely unrelated to the class. I ended up dropping the class and the admin agreed to refund me due to the nature of the incident. He kept teaching and nothing changed. I don't think you want that outcome.
Another incident I helped a friend file a complaint about a professor who kept saying racist stuff in our joint class. First we talked to the ombundsperson and she helped us contact the Equity and Human Rights department who address student complaints and retrain teachers as necessary. So I recommend contacting your ombundsperson because they will know your options and there are no risks to talking to them. (The teacher got a reminder to stop being racist, but according to friends who had to take his class he didn't change at all).