Michael B. Enzi, a Wyoming Republican who retired in January after 24 years in the U.S. Senate, had not counted on a life in politics. Trained as an accountant, he spent his early career running a shoe store in Gillette, Wyo., an energy boomtown where he attracted customers with a carousel. Flicka, Fury, Ginger, Beauty, Silver and King were the names of the wooden horses beckoning children into the store.

By his account, he did not think of running for office until he met future U.S. senator Alan K. Simpson (R-Wyo.), then serving in the Wyoming House, at a gathering of the Jaycees, a civic organization for young people. Mr. Enzi, who spoke at the event about leadership, was 29 at the time.

“I don’t even know what party you’re in, but it’s time you put your money where your mouth is on this leadership stuff and get into politics,” Mr. Enzi recalled Simpson saying. “That town you live in, Gillette, needs a mayor.”

“On the way home from that Cody meeting, while my wife was driving, I told her what Senator Simpson had said and that I was thinking maybe I should run for mayor,” Mr. Enzi recounted. “It must have come as quite a shock because she ended up swerving down into the barrow pit and back up onto the road.”

Mr. Enzi went on to serve two terms as mayor of Gillette, 10 years in the Wyoming legislature and, beginning in 1997, four terms in the U.S. Senate.

He chaired two committees — the Health, Education, Labor and Pensions Committee from 2005 to 2007 and the Budget Committee from 2015 until he stepped down.

Mr. Enzi, 77, died July 26 after suffering injuries in a bicycling accident near his home in Gillette three days earlier. He was flown to a medical center in Loveland, Colo., where he did not regain consciousness, and where he died, according to a statement distributed by a spokesman, Max D’Onofrio.

In a Senate often described as being composed of workhorses and showhorses, Mr. Enzi was widely regarded as belonging to the former category. He declined to appear on television talk programs because their purpose, he once told the New York Times, seemed to be to persuade guests to “beat up on their colleagues.”

A solid conservative from a deeply Republican state, Mr. Enzi also earned a reputation, in the description of the Almanac of American Politics, as a “mild-mannered” pragmatist “skillful in working both sides of the aisle and in winning back-room legislative battles.”

He was particularly known for his effective working relationship with Sen. Edward M. Kennedy (D-Mass.), who chaired the Health, Education, Labor and Pensions Committee during times of Democratic majority.

Mr. Enzi operated on what he described as the “80 percent tool.”

“Generally speaking, people can talk civilly on 80 percent of the issues,” he said in a farewell speech on the Senate floor. “It’s only about 20 percent of issues where you will find real contention.

“Now even on the individual issues you might find disagreement, but once again you need to focus on the 80 percent of that issue that you can agree on. It is all about focusing on what you can get done, and not focusing on the points of disagreement — the weeds of debate that have choked issues. Or to say it another way, it’s all about what you leave out.”

Mr. Enzi successfully collaborated with Kennedy on the reauthorization of the Head Start program serving low-income children and on legislation that required insurance companies to cover treatment for mental illness in the same way that they covered treatments for other conditions.

During the battle over the Affordable Care Act, the 2010 legislation widely known as Obamacare, Mr. Enzi belonged to the so-called Gang of Six senators that sought a bipartisan deal on the overhaul of the health-care system.

(The other members included three Democrats — Max Baucus of Montana, Jeff Bingaman of New Mexico and Kent Conrad of North Dakota — and two Republicans in addition to Mr. Enzi, Charles E. Grassley of Iowa and Olympia J. Snowe of Maine.)

It was an intense effort, with the group holding hours-long sessions multiple times a day, but in the end it yielded no compromise. Amid conservative tea party fervor, the Affordable Care Act was passed without a single Republican vote.

In his reelection campaigns, Mr. Enzi rarely faced serious opposition until 2013, when Liz Cheney, the daughter of former vice president Richard B. Cheney, announced that she would challenge him for his Senate seat. Mr. Enzi was close to her father, a fly-fishing partner. “I thought we were friends,” Mr. Enzi remarked to reporters when Liz Cheney declared her plans to run.

The threat of a primary battle seemed poised to upset the GOP in Wyoming but ultimately subsided. Liz Cheney withdrew, winning the state’s at-large U.S. House seat two years later, and Mr. Enzi won his fourth and final term in the Senate. He was succeeded this year by Cynthia M. Lummis, also a Republican.

Michael Bradley Enzi, the son of a shoe salesman, was born in Bremerton, Wash., on Feb. 1, 1944. He grew up in Wyoming, graduating from high school in Sheridan, before moving east for his undergraduate studies. He received a bachelor’s degree in accounting from George Washington University in 1966, then received a master of science in business administration degree from the University of Denver in 1968.

Mr. Enzi settled in Gillette, where he started his business, NZ Shoes, in 1969 and married Diana Buckley the same year. They later expanded the shoe business to include stores in two other cities, with Mr. Enzi serving in the Wyoming Air National Guard from 1967 to 1973.

Besides his wife, of Gillette, survivors include three children, Brad Enzi of Laramie, Wyo., Emily McGrady of Cheyenne, Wyo., and Amy Strom of Reno, Nev.; and four grandchildren.

After serving as mayor of Gillette for two terms beginning in 1975, Mr. Enzi served in the Wyoming House from 1987 to 1991 and then in the state Senate until his election to the U.S. Senate in 1996. In that race, he defeated future U.S. senator John Barrasso in the Republican primary and Democrat Kathy Karpan, a former Wyoming secretary of state, in the general election.

In his farewell address, Mr. Enzi reflected on the 80 percent rule and the accomplishments he said it might yield if more lawmakers adhered to it.

“Following the 80 percent tool will not get you notoriety, fame or even the headlines,” he observed. “Most media coverage requires ‘blood in the water.’ However, the ability to work among your peers using this method can — and will — move us forward and get things done.”