CAPT. DONNY GORDON of the Contra Costa County Sheriff’s Office remembers his first arrest as a deputy sheriff more than 20 years ago. It came in a remote section of East County after a routine traffic stop in the dead of night. After checking with dispatch, he learned the driver of the car was wanted and described as “armed and dangerous.”

Let Gordon explain: “I’m out there in the middle of nowhere, it’s pitch black, and every bad movie I’ve ever seen is running through my head. I got my shotgun, walked up to the car and told the guy to handcuff himself to the steering wheel.

“Then I waited the longest seven minutes of my life for backup. I probably looked like Barney Fife, I was shaking so hard.”

Lt. Vic Fernandez has a similar story from earlier in his career. A suspicious-looking driver he pulled over claimed to have no identification, but Fernandez spotted his wallet in the car.

“I ran his name through the system, and he was wanted for murder,” Fernandez said. “He had murdered his girlfriend and concealed her body.”

Not every day in the life of a deputy sheriff plays out like a scene from “Dirty Harry” — Fernandez reflects with equal satisfaction on the time he helped a lost boy find his way home — but the officers who patrol the streets of unincorporated Contra Costa County do plenty of crime-stopping that goes unnoticed. (The department filed 3,624 crime reports in a recent three-month span.)

It’s when they miss an opportunity to close a high-profile crime that bells and whistles sound.

The Sheriff’s Office still is reeling from a missed chance to apprehend Phillip Garrido in 2006, when a deputy answered a neighbor’s complaint about suspicious sounds coming from the backyard where kidnap victim Jaycee Dugard was held. Sheriff Warren Rupf solemnly accepted responsibility for the missed chance, but that hasn’t lessened the pain.

“We take our losses very personally,” Gordon said. “When we get scrutinized, we carry that burden.”

His steely eyes spoke more loudly than his voice.

For those who watch from a distance, it’s hard to comprehend the enormity of the department’s task. It’s responsible for policing 750 square miles of Contra Costa County, serving 1.2 million residents and coordinating jurisdictional efforts with more than a dozen municipal police departments.

Perhaps the best way to grasp the challenge is from inside a patrol car, which is why we arranged last week to accompany deputy sheriff Andy VanZelf.

VanZelf has done it all in his 23 years on the job, working in the narcotics, canine and patrol divisions. His current beat spans the unincorporated areas of Martinez, Vine Hill and Pacheco, a sprawling area formerly patrolled by two cars. Budget cuts now limit it to one.

On an average day, he said, he drives 100 miles or more. He travels them slowly, watching for telltale signs of potential trouble.

“Every day is different,” he said. “I always change my route. But I’ve worked the area long enough to know where the players are. I keep a high profile in those areas.”

The “players” are repeat criminals and their associates, many of whom are involved in drugs, especially methamphetamines.

“I’m a firm believer that drugs are the root of all evil,” he said. “People steal to buy dope. If the seller doesn’t get paid, somebody gets shot. And once people are on it, they lose all perspective.”

Most meth these days comes from Mexico, he said, but it can be found anywhere. Our route featured less-traveled side streets winding through many buildings in disrepair. At one point, he pointed to a lot where a drug user had burned down his house. Nearby, a double suicide had taken place.

He cautioned, however, against associating crime solely with neighborhood. “Some of my friends have been involved in shootings in Danville, so it can happen anywhere.”

Deputies remember shootings. They leave an indelible mark. The first time VanZelf had to draw his gun, he said, “It scared the hell out of me.

“Every cop who’s been in a situation where he’s had to draw his gun, after he leaves the scene you’ll see him pull over his car to think about all the things that could have happened.”

It’s natural to wonder what draws a person to such a job, where danger lurks around the next corner and every mistake can result in a headline.

Gordon said he heard the call after a deputy came to investigate the break-in of his truck. Fernandez said after he finished military duty he wanted to do something that helped people. VanZelf said he was born to the job — his mother, father and brother were cops — but that’s not why he stuck with it.

Five reputed Vallejo gang members, one of them already convicted of murder earlier this year, appeared in Solano County Superior Court on Friday to face more legal proceedings in the coming weeks in connection with the shooting deaths of three men in 2017 and 2018 in Vallejo.

A Mountain View entrepreneur who developed a device to help patients with chronic obstructive pulmonary disease, or COPD, captured the $20,000 first prize in the 19th annual Big Bang! Business Competition at UC Davis.