SANTA CLARA >> Alex Barrett wrote the name “JOEY” on his right wrist and “265” on the left wrist. This completed his uniform last Sunday, when he gratefully played for the first time in four years for the 49ers.

“It was very euphoric for me,” Barrett said Thursday.

Barrett paid a subtle but significant tribute to Joey Counts, his beloved teammate from his days at Desert Ridge High School in Mesa, Ariz. The “265” represented Counts’ badge number as a Gilbert firefighter for the past few years, up until his unexpected death on Nov. 27.

Barrett made sure Counts — and mental health awareness —did not go unnoticed last Sunday, even after the 49ers sustained a 29-17 defeat to the host Miami Dolphins and were officially eliminated from playoff contention. While posting a picture on Instagram of a second-quarter tackle he made, Barrett’s caption offered a nod to Counts — and a message to all:

“During this holiday, I ask anyone who sees this post not to take anyone in your life for granted. Although it can be painful at times life is way too precious and you do not have to walk this journey alone. You are loved and you are wanted!”

So many 49ers have overcome personal anguish to push through this season. Not all are household names. Not one should be minimized.

Inside the 49ers locker room on Thursday, Barrett again emphasized the need for mental health awareness, proudly recalling Counts’ days as a dominant running back in Mesa, then at the University of Montana.

Jeremy Hathcock, their former Desert Ridge coach, told AZcentral.com that Counts was “unbelievable” and “an even better person. It’s crazy.”

Barrett’s NFL journey is certainly worth its own review as he and the 49ers (6-9) play their penultimate game of the season on Monday night against the Detroit Lions.

The last time the Lions came to town, the 49ers rallied past them for the NFC Championship. In the practices leading up to that 49ers win, Barrett lined up on scout team and impersonated Aidan Hutchinson, the Lions’ star defensive end. That type of behind-the-scenes work has kept the versatile Barrett around since the 49ers signed him Nov. 27, 2019.

Barrett actually got his NFL start with the Lions as an undrafted free agent out of San Diego State in 2017. He played their first two games that season, then headed to the practice squad. It’s that NFL grunt work he’s toiled most of his career as a 6-foot-2, 250-pound defensive lineman who plays on the interior or on the edge, as needed.

Since appearing in seven games with the 49ers’ 2020 team — which also careened out of playoff contention because of injuries — Barrett kept at it on the practice squad, year after year, up to Sunday’s suit-up in Miami.

“It was a definitive moment in my career,” Barrett said, “to see all the hard work pay off.”

He played just four defensive snaps but 21 on special teams, where he made his second-quarter tackle of kick returner Malik Washington at the Miami 31-yard line.

More meaningfully, Barrett played, and he could again Monday night; No. 4 defensive end Robert Beal Jr. missed Thursday’s practice with an ankle injury. Barrett’s approach this week is like all the previous weeks, year after year: “Stay ready to contribute.”

Such is life for most NFL players. They’re battling just to keep a job.

Even teammate Nick Bosa, the NFL’s highest-paid defender, isn’t eschewing these final games. “It’s not hard to come into work,” Bosa said. “There’s a lot worse jobs to have than playing a sport and making good money. So I’m happy to come in.”

So is Barrett.

Editors Note >> If you or someone you know is struggling with feelings of depression or suicidal thoughts, the 988 Suicide & Crisis Lifeline offers free, round-the-clock support, information and resources for help. Call or text the lifeline at 988, or see the 988lifeline.org website, where chat is available.