The defenseman recorded a video and texted it last week to Ty Cornett, a 13-year-old Detroit-area hockey player.
Cornett's father, Matthew Cornett, shared the video, which was recorded in Detroit during the Predators' visit to the city last week, on Reddit.
"I can tell you this right now: As long as you're still breathing in this world, you've got to believe in yourself and let nobody tell you what you can and can't do. Especially if it's because of the color of your skin," said Subban, who is black and was born in Toronto and previously starred with the Montreal Canadiens.
"In this world, some things happen that we don't really understand. That's OK. We don't have to understand them. All we need to do is understand ourselves, believe in ourselves, keep trying and keep pushing forward.
"I just want to tell you that when you're playing hockey, you play because you love the game and you want to play. Let nobody take that away from you."
Matthew Cornett says Ty had asked for a Subban Canadiens jersey when he was 6 and wears the same No. 76 as the player.
"This year has been tough," Matthew Cornett wrote. "My son is very aggressive and loud, so that brings out the trash talk. I have no problem with trash talking at all (part of the sport), but the racist talk needs to stop. Between the N-word being thrown at him over and over, being called monkey by players and parents, having an entire team beat their chests and act like gorillas whenever he touched the puck.
"This video meant more to my family than anything. I think my son has watched it over 500 times (no joke)."