SANTA CLARA – Jimmie Ward experienced a lot of bad breaks, literally and figuratively, since coming to the 49ers as the No. 30 overall pick in the 2014 draft.

It is possible that all the adversity he endured has enabled him to reach this point in his career where he is a better player on the 49ers’ best team since he has been in the league.

“It was really tough, and I was just fighting to survive in the NFL,” Ward said. “Even though I was a first-round pick, I didn’t feel like I was first round because – I don’t know – I barely got drafted in the first round, and it wasn’t like I was playing safety.

“I had to play where I was needed. When I got here, they already had two safeties, so I never really felt like that guy.”

Ward always has been considered one of the 49ers’ best 11 defensive players, but there was no room for him initially at his preferred position because the club already had Antoine Bethea and Eric Reid entrenched at the safety positions.

In his first four seasons, Ward had four different head coaches and four different defensive coordinators and four different defensive systems.

He had no stability and no chance to get comfortable in one spot. In his first five seasons, Ward bounced from nickel back to safety to cornerback to safety and back to cornerback while also finishing four of those seasons on injured reserve with foot, collarbone and two forearm fractures.

“Whenever you go through what Jimmie’s gone through, all those tough times, I believe it’s going to do two things to you: It’s either going to make you fold or it’s going to make you stronger,” 49ers defensive coordinator Robert Saleh said. “Jimmie’s gotten nothing but stronger through all of this.

“He’s become smarter, he’s become more versatile, he’s become more relentless because it’s very important to him. Take a guy off the field for any reason and I promise you they’ll do everything they can to get back on the field. Being on the field, he doesn’t take it for granted.”

Things seem to be settling down for Ward as he settles into the position he loves more than any other.

Finally, Ward seems to have found a home at free safety. And the 49ers have turned the corner this season to emerge as one of the NFL's top teams, featuring one of the league's top defenses. They meet the Green Bay Packers in a key NFC matchup on Sunday night at Levi’s Stadium. The 49ers sit in the top spot in the division and conference with a 9-1 record. The Packers are 8-2.

The tough times, the constant shuffling of positions and the nature of his injuries all have contributed to Ward playing the best football of his career as the 49ers appear destined for the postseason.

“If you don’t fail, you don’t learn,” Ward said. “If you don’t get beat in this game, you don’t learn. We lost a lot of games, and I got beat at multiple positions.

“My rookie year, coming in, I had to learn how to play certain wide receivers. Playing corner, something I didn’t do, I had to learn different techniques with different coaches. But each coach and each defense brought something new to my game. And when I finally got back to safety, that was home.”

Still, Ward believes there is more out there.

“I’m getting better each week. Hopefully, I end up playing safety next year,” Ward said, laughing. “I’m not doing too good. I’m not doing too bad. I feel like I’m in the middle right now. The defense is so good right now, everybody is making plays.”

Ward said he is having a lot of fun this season, but he is keeping all of the team’s success in perspective. He faces a huge challenge against Packers quarterback Aaron Rodgers, but there will be more important challenges ahead, too.

“Sunday is not the Super Bowl,” Ward said. “It’s not even the playoffs. I get excited each game when I go out on Sundays, but I’m just saying, it’s nothing to get too high about, and it’s nothing to get too low about.”

Ward has been important to the 49ers’ defense because he fills the role of the “eraser.” His job is to make sure the 49ers’ defense does not surrender big, game-changing plays.

But Ward expects himself to make more big plays of his own, such as creating takeaways. He has not registered an interception since 2016. It will be difficult to pick off Rodgers, who has 17 touchdown passes and just two interceptions this season.

[RELATED: Kittle doesn't want to miss 'massive' game vs. Packers]

Ward's job is to prevent the opposition from connecting on big plays resulting in touchdowns. The 49ers have surrendered an NFL-low 18 pass plays of 20 yards or more, so Ward is doing his job.

"He's incredibly versatile. He’s a really smart player," 49ers cornerback Richard Sherman said. "I think sometimes when you play that many positions in a complex defense, it puts you in positions where you’re not able to be successful, but I think it gave him experience, poise and confidence to be able to play all over the field, to play man coverage, zone, and it’s allowed him to thrive in the scheme we’re in now."

Ward has kept a measured approach to all of the adversity he has faced in his career, including the early portion of this season, as he fought to get back on the field.

He also fully realizes how quickly things can change.

“Those were some tough years,” he said. “I’ve been through some things. I stuck it out through the storm. Now, there’s a little sunshine.”