Through all his years of playing hockey, Ryan O’Reilly never forgot one piece of advice his father, Brian, gave him. “He always said, ‘You can’t score from the penalty box,’ ’ the Colorado Avalanche forward recalled. “In key situations, if you stay out of the box and on the ice, you have a chance to help your team win.’’

And if you spend only two minutes in the box all season, you can help your team to the playoffs, become one of its most productive players and land a place among the three finalists for the NHL’s Lady Byng Memorial Trophy.

O’Reilly was assessed one minor penalty in 80 regular-season games, for not immediately dropping his stick when it broke during a faceoff. That infraction happened March 29, in his 72nd game of the season.

O’Reilly added his second goal of the playoffs Thursday in the Avs’ 2-1 loss to the Wild in Game 4. He is also sustained another penalty-free streak in the postseason, despite leading the Avalanche forwards in ice time and playing outstanding defense.

“Growing up, I always took pride in discipline,’’ said O’Reilly, who scored a career- and team-high 28 goals this season. “I never liked being in the box.

“I think I had a lot of good luck [this season]. I was dealt a good hand.’’

In his fifth NHL season, O’Reilly, 23, tallied a career-best 64 points and led the Avalanche with nine power-play goals and six game-winners. He also topped the NHL with 83 takeaways, leading the league in that category for the second time in three seasons.

Brian O’Reilly, a life coach who works with athletes, stressed the importance of discipline to sons Ryan and Cal from the time they took up hockey. Ryan plays a physical yet highly controlled style, using his ability to read his opponents to subdue them without making illegal contact.

As a kid, O’Reilly said, he often played against Cal — who is five years older — and other bigger, stronger players. That helped him develop into a fundamentally sound player who has only 52 penalty-minutes in 345 NHL games.

“I was always good at reading the guy I was playing against,’’ said O’Reilly, the 33rd overall pick in the 2009 NHL draft. “I could see when he was off balance, when to strike, when to start taking the puck away. I took pride in that from a young age, being able to cause turnovers and take away the puck. And it’s still a staple of my game.’’

Linemate Jamie McGinn is among those who marvel at O’Reilly’s remarkable run this season. O’Reilly joined former Los Angeles center Butch Goring as the only NHL players in history to be assessed two or fewer penalty minutes over 80 or more games.

“It’s pretty amazing,’’ McGinn said. “When you see him out there, he does work very hard, and he’s very good with his stick. It’s an amazing accomplishment; even if you look at his one penalty, I don’t think it was a penalty. He plays within the rules.’’

Tuesday, O’Reilly was named a finalist for the Lady Byng trophy, given to the player who combines sportsmanship and “gentlemanly conduct’’ with outstanding play. The other finalists are Patrick Marleau of San Jose and three-time winner Martin St. Louis of the New York Rangers.

“I’m really excited to be nominated,’’ O’Reilly said. “It’s a true honor.’’