I was standing at the blue line with our coaching staff in San Jose on June 12 when the gentlemen in the white gloves brought out the Stanley Cup. This was a moment I had been chasing for 10 years, since I first won the Cup as the GM of the Carolina Hurricanes in 2006.

Our captain, Sidney Crosby, lifted the Cup over his head, and I felt great for him, knowing all the hard work he put in to lead us to this point. But I felt even better for the guy Sid handed the Cup to next.

Trevor Daley had hobbled out onto the ice for the celebration with a broken ankle. He had changed into his uniform and was still sporting a full playoff beard. Sid skated right over to him, said a few words and handed him the Stanley Cup.

It was one of the more emotional moments I’ve had in my 30-plus years as a general manager.

A lot of people probably thought Trevor was the captain’s choice because he was a 32-year-old veteran who had sacrificed his body for the team and had just won his first Stanley Cup.

But there was a much more important reason. Trevor’s mother, Trudy, was watching on TV from her hospital bed in Toronto, where she was battling cancer.

Trevor’s mother had made him a promise, and he was holding up his end of the deal.

Earlier in the playoffs, Trevor had gotten the difficult news that his mother didn’t have much time left. He asked me if he could take a quick trip home to see her. Any time one of my players is struggling with a serious family issue, I give them time to deal with the situation — even if it means missing a game.

So Trevor went home to see his mother. When he returned to Pittsburgh a few days later, I asked him how she was doing. He told me what she had said to him right before he had to leave, and it gave me goosebumps.

“Don’t worry,” she said. “I’ll be here to watch you lift the Stanley Cup.”

Unfortunately, during the Eastern Conference finals, Trevor took a hit behind our net and his skate went into the boards the wrong way. It was a freak accident. After the game, we got the bad news. His left ankle was broken. He was done. At the time, everyone in the room was heartbroken for him, because he was playing so well for us, and he’s such a terrific guy. For him to miss his chance to play in the Stanley Cup Finals was just terrible.

But there was a silver lining. Since he was sidelined, Trevor was able to go see his mother in Toronto a few more times over the rest of the playoffs.

So when those guys in the white gloves brought out the Stanley Cup, my mind immediately went to Trudy Daley.

She hung in there. She only lived another two weeks after that special night in June, but she hung in there long enough to see her son fulfill his boyhood dream of lifting the Stanley Cup.

It was a very, very special moment.

As a GM, you’re always asking yourself how you can build a winner. Yes, you absolutely need guys with speed, talent and hockey IQs. But you also need guys with strong character, because a hockey season will throw all kinds of things at you that you could never see coming in July.

Trevor then handed the Cup to Pascal Dupuis, who had been forced to retire six months earlier due to recurring blood clots. It was an agonizing decision that I had been a part of, and for a true pro like Pascal to get an ending like that was so fitting.

Pascal then passed the Cup to Marc-Andre Fleury. You won’t find a guy with better character in this league. Flower had carried us in the regular season between the pipes, but he needed to take a backup role to Matt Murray in the playoffs. He never complained. He never let it get in the way of him helping Murray. To be that selfless is rare for a goalie. (I know, because I was one.)

As the Cup was handed down the line, it was raised by guys who had been deemed too small, guys who had been described as “over the hill,” guys who had been traded, guys whose leadership had been questioned in the media, and even by guys who had dealt with things that went way beyond hockey — cancer scares, strokes, deaths in their families.

As a general manager, that Stanley Cup celebration was a reminder of just how complicated — and how rewarding— the game can be.

The Players’ Tribune asked me to explain my job, which is kind of an interesting challenge. If you talked to my eight-year-old son, being a general manager is all about signing free agents and making trades. (He comes up with some amazing All-Star-for-fourth-liner proposals during breakfast.) But in reality, that stuff is only about 10% of the job.

The majority of the job is about surrounding yourself with smart people, managing personalities, and, of course, making sure that your franchise is financially sustainable. (This one might seem boring, but it’s very important.)

I began my career as a GM with the Hartford Whalers in ’94, just three years before the team moved to Carolina. At the time, the city of Hartford was going through economic turmoil. The insurance companies that had been the bedrock of the team’s corporate revenue were closing or merging, and we basically had a three-year window to make the franchise financially sound. There were a lot of people in the Hartford community who tried to help us, but it soon became clear that it was an economically unsustainable situation.

That made a real impression on me. It was a very emotional time. You had team employees who lost their jobs, players who had to uproot their kids from school and a city that lost its sports identity. We had 12,000 die-hard fans, but in those days, it wasn’t enough to balance the losses the franchise was taking. We had to say goodbye.

What happened in Hartford is a constant reminder to me that this is a business. As a GM, you need to be thinking beyond just today, or this season. You need to build a franchise that is sustainable. That’s where the pressure comes in.

When you have a deal on the table, you think about many different factors: a guy’s character, the culture fit, the system fit, and, of course, your salary cap situation — not just this season but two or three years down the line.

The game I’m watching during the regular season might not even be the game I’m thinking about. I might be thinking about the deadline. I might even be thinking about next year. My mind is typically thinking about something beyond the present moment.

When I was in Carolina, I had this putter in my office, and whenever our team was thinking about making a deal, I’d grab the putter and walk the hallways. I guess it helped me think. The line around the office became, “If you see Jim walking around with his putter, something’s brewing.”

Ultimately, as a GM, you’re constantly trying to solve this puzzle: How can I build a team that can win a Stanley Cup? Not make the playoffs. Not compete. Win the thing. If not this year, then in five years? It’s a long game, not a short one.

In order to solve the puzzle, you have to be paying attention to the landscape of the league as a whole. This is very important. Both of my Stanley Cup teams came together after some pretty big shifts in the way the game was being played. With the 2006 Hurricanes, we knew that the game was going to be officiated differently after the lockout. The league was cracking down on the clutch-and-grab style that defined the ’90s, so we went after players who would excel in the new environment.

The league always moves in cycles. And there’s not just one way to win. When I came to Pittsburgh in 2014, the trends had been flip-flopping back and forth. L.A. won with size and physicality. Chicago won with skill and discipline. (Personally, the Blackhawks are my favorite team to watch and learn from.) Then the Kings won again … size again. Then Chicago won again … skill again. Once a team wins with a certain philosophy, the rest of the league moves to either copy or counter it.

The answer isn’t to follow along with the trends. The answer is to figure out the best identity for your team.

When we lost to the Rangers in the first round of the 2015 playoffs, I realized that we had to get faster in order to compete for the Cup. New York had this fiery little Swedish guy who had given us fits in that series by the name of Carl Hagelin. He was constantly disorienting our defensemen with his speed on the forecheck. I filed that one away in my box. (We’ll get back to the box, and to Hagelin, in a minute.)

Going into the off-season, our objective was to get a lot faster. (And, this should go without saying, but the more character you can add in that room to go along with Sid’s leadership, the more chance you have of winning over the long grind of the playoffs.)

In July, when it became clear that we had a shot at bringing in Phil Kessel, we had to make a big decision. Acquiring Kessel would cost us not only young talent and draft picks, but it would also come with a significant salary-cap hit. There’s always a cost. In this case, we had to be sure that Phil would fit into our room, and into our system.

In times like that, you have to rely on your box. Inside your box is all the stuff you can’t look up on the Internet. During your travels in this game, from city to city, hotel to hotel, you talk to a lot of people. You hear things. You learn all kinds of things about players. And you file it all away in your box. Over my 30 years as a GM, my box has gotten pretty full.

It was always my understanding from my intel around the league that Phil was a good guy. If I have one defining management philosophy, it’s that I really believe in second chances. If a player is a good guy, and he’s got talent, and you give him a second chance, he’ll give you everything he’s got.

The Kessel decision ultimately came down to a simple fact about the NHL that never seems to change: It’s hard to score goals in this league. It’s just hard. But Phil was a guy who had scored them year after year. He had been in a fishbowl in Toronto and he still scored 30 every year. I felt if we gave him a second chance, he’d really thrive in Pittsburgh.

So Phil came into our locker room that fall and, after watching him for a few weeks, I filed a new note into my box:

Phil Kessel isn’t a good guy, after all. He’s a great guy.

I didn’t know it at the time, but we wouldn’t have won the Cup without Phil. When Evgeni Malkin went down with an injury in March and we were fighting to secure a playoff spot, we desperately needed to replace his goals. Phil was brilliant for us during that time, and he was able to play his game because of his linemates on the “HBK Line.”

The H on that line was Carl Hagelin.

Anaheim had snatched him up in the summer, but hockey is a funny game. Fit is so important. Carl was struggling during the first half of the season, and in January his name came up as a trade possibility in our office.

At that point, it was becoming clear, especially in the second of back-to-back games, that we still weren’t fast enough. When we made a coaching change and implemented a more aggressive system under Mike Sullivan, the need for guys who could play fast became even more apparent.

Hagelin seemed like a fit.

But why was he playing so poorly out West? What was the potential downside of bringing him here? I hold very few long meetings with my hockey-operations team. Most days, we’ll have about 20 impromptu mini meetings where a guy’s name will come up, and we’ll watch some tape on the guy, and we’ll share whatever info we have stored in our boxes.

If a name survives that meeting, we’ll run it through the full wringer: analytics, hockey ops, scouts, and then eventually go to our coaching staff to get their thoughts.

If you just looked at the stats, you might think that Hagelin was a risky proposition. But if you watched 10 minutes of the Ducks, you could see why he wasn’t a fit for their methodical, physical style of play. I thought back to him scoring big goals against us in the playoffs, and how he made our defensemen’s lives miserable on the forecheck.

We had a good guy in David Perron on our team who needed a change. Perron was physical. Hagelin was fast. Both were 27. It was a solid swap for both teams. Those are the trades you feel best about.

The day we finalized the trade I knew we had made the right decision, because when I ran into Patric Hornqvist in the hall, he was smiling.

He said, “We got Hags?”

I said, “Yes we did.”

He said, “Did you know he’s my best friend?”

Hagelin turned out to be a huge addition for us, not just on the ice, but also in our room. Of course, hindsight is 20/20. There are plenty of deals that don’t work out. Every time you pull the trigger, there’s a chance you’re making a mistake. It’s important to remember that players are human beings.

Analytics are a big emphasis for our hockey-operations team, and I have an excellent team that looks at players from every angle. But, as a decision maker, you need to know the context behind the numbers.

Why is this guy struggling?

What’s his personality?

What’s going on tactically on the ice?

What’s going on off the ice?

This brings me full circle to Trevor Daley.

In December, a month before we traded for Hagelin, Daley’s name kept coming up in our office. I had really admired his game when he was in Dallas. He was fast, strong and great on the breakout. When the Blackhawks traded for him, I thought it was a good fit.

But, for some reason, Daley was really struggling in Chicago.

So our team had a mini meeting, and we did what we always do. We watched him.

The problem jumped out at me right away. Trevor was on the left side of the TV screen.

Trevor is lefthanded. Chicago was playing him on the left side.

Most people watching would think, “So what? Isn’t that his natural side?”

It is. Most defensemen like playing on their natural side, so that when their defensive partner passes the puck “D-to-D” behind the net, they can catch the puck on their forehand.

But I knew from my box that Trevor actually liked to play on his off-side. He played on the right side in Dallas. Watching him in Chicago, you could tell he was uncomfortable on breakouts.

On the ice, he wasn’t in the best position to succeed. But there was also another factor that I knew very well from my time in Carolina. See, when you’re a new player brought in to a team that has just won a Cup, you don’t always feel part of it. It’s very hard to integrate. The team is going to have its ring dinner, it’s going to have the opening night ceremony, and all the chatter in the locker room will always seem to go back to, Remember last season when….

As hard as a player might try, it’s difficult not to feel like an outsider in that situation. I felt like Trevor might be going through that and could use a change of scenery.

Ultimately, what I knew about Daley for sure was that he had two characteristics that would never change no matter where he was playing: determination and character. When a player has those two things, you’re willing to take a chance and see where it goes.

At the time, I didn’t know about his family situation. I didn’t know how instrumental he would be in leading our team. I didn’t know that the story would end with one of the most emotional moments of my career — watching Trevor lift that Cup for his mother.

After looking at the deal from every angle, what I asked myself before I got on the phone with Stan Bowman in Chicago was the same question I’ve used to guide almost every move I’ve made over the last 30-plus years.

“Does this guy have the heart?”

Call me old-fashioned, but I think that question will take you a long way in this game.