Sharks coach Ryan Warsofsky couldn’t believe his luck.

The Marshfield, Massachusetts native was a teenager 20-plus years ago when his dad won a contest to go behind the scenes with the Boston Bruins. Pulled out of school for the day, Warsofsky went to TD Garden, saw some players up close, and watched Mike Sullivan, then the Bruins’ head coach — and now a close friend — run the team’s morning skate.

“I bring my son in here once in a while, and he doesn’t know how lucky he has it being around these guys and hanging out with the guys,” Warsofsky said last Monday in San Jose. “Because I did it once ... and it was the best day of my life.”

Warsofsky, now 37, will be behind the bench at TD Garden this afternoon — this time as an NHL head coach — when the Sharks face the Bruins in the fourth game of a five-game road trip.

“It’s going to be awesome,” Warsofsky said. “It’s probably the game I had circled the most, besides opening night.”

The same holds true for Sharks players Will Smith, Collin Graf and Henry Thrun, all of whom hail from Massachusetts and have never played an NHL game inside the downtown arena. Macklin Celebrini also has obvious ties to the area, having won the Hobey Baker Award as college hockey’s top player after a standout freshman season at Boston University.

“It’s big. A dream come true,” said Smith, a Boston College alum who grew up in Lexington, a Boston suburb.

Smith said he has played inside the Garden a few times, namely during the annual Beanpot tournament that features teams from Boston College, Boston University, Harvard and Northeastern. But, Smith added, “Against the Bruins, it’s going to be pretty special.”

The Sharks’ ties to the Boston area run deep.

General manager Mike Grier, who turned 50 earlier this month, was born in Detroit but moved to Massachusetts in the late 1970s when his dad, Bobby, became the running backs coach at Boston College. Bobby Grier would later go on to an 18-year career with the New England Patriots, serving a coach, scout and player personnel executive.

Sharks senior advisor Tim Burke and director of player personnel Scott Fitzgerald are from Melrose, Massachusetts.

Warsofsky attended Marshfield High until 2006 before he went to Boston’s Cushing Academy, where Hall of Fame defenseman Ray Bourque was an assistant coach during the 2006-07 season.

During those years, Warsofsky got a chance to skate at the Garden with former Bruins captain Patrice Bergeron, current New Jersey Devils general manager Tommy Fitzgerald, now Ottawa Senators coach Travis Green and longtime NHLer Hal Gill, now a radio color analyst for the Nashville Predators.

“I remember a lot of those guys. They probably don’t remember me being around,” Warsofsky said. “I remember sitting in (Sullivan’s) office talking a lot of hockey, and that’s probably when I first got the bug to coach, is being around those guys.”

Smith said he used to attend around 10 Bruins games a year. He was in the crowd last season when the Sharks visited Boston on Nov. 30, 2023.

Smith was in attendance for Game 7 of the Bruins’ first-round playoff series against the Toronto Maple Leafs in 2013, when they trailed 4-1 midway through the third period. Boston then scored three goals in 9:51 to tie the game before Bergeron scored the series-clinching goal in overtime.

Now, nearly 12 years later, Smith will play his first NHL game on that same ice surface.

“I’ll have tons of people there that I know,” Smith said. “Probably over 100 people in that building.”

The Sharks have a long way to go before they can start thinking about the playoffs, as they’ve gone 4-15-1 since early December and enter Monday in next-to-last place in the NHL’s overall standings with 34 points. Including their 4-1 loss to the New York Islanders on Saturday. The Sharks have scored just one goal in four of their past five games.

TOFFOLI OUT >> Warsofsky told reporters Sunday that winger Tyler Toffoli will not play against the Bruins. Toffoli sustained a lower-body injury during the Sharks’ morning skate at UBS Arena in New York on Saturday and did not play against the Islanders. Toffoli is considered day-to-day, Warsofsky said.