How do I deal with this?

My older cousin is more like a brother figure to me. I have a 16 month old daughter who he is usually great with and very kind to. I love him a lot.

There have been occasions at family functions when he has had a drink, and he makes a lot of racist remarks speaking to my daughter. (We are white)

He has tried to teach her the word “kaffir” which is a derogatory term for black people - I had never heard the term before he says it

He will also say to her “no blacks” as in when she’s older and starts to date

Aside from this he is very loving kind and caring but obviously I have a problem with this

Maybe worth mentioning that he is currently self harming and suicidal so I would hate to say something to make it worse

I know I sound foolish saying he’s kind etc but unless you know him you wouldn’t believe me based of this post