This story appears in ESPN The Magazine's Feb. 4 Perfect Issue. Subscribe today!

THE MOST INFLUENTIAL football coach of the past 30 years hated his legacy. He hated it from the moment he retired at age 57, in January 1989, days after winning his third Super Bowl as head coach of the 49ers. Bill Walsh had felt fried for years, and during that last season he was in "a claustrophobic panic," as a friend later described it. Or "just eking by," as his son Craig recalls. That 1988 season had been the most wrenching of his career, because the 49ers were not a great team. They were a 10-6 team that happened to win it all, and the grind swallowed Walsh to the point that he was, as his son says, "like a zombie." So he secretly decided to retire during the season, and in the whooping and wet locker room after the Super Bowl, Walsh wept alone, head in his hands. He wasn't happy. He was relieved. It was over.

That image, of course, doesn't square with the Walsh in old footage: elegant and confident, handsome and professorial, walking a damp Candlestick Park sideline in a sweater and khakis, fog-white hair neatly combed, holding a pencil to his lips as he plotted his next move, which always seemed to be two ahead of his opponent. But that's how he was. He always coached through existential torture, with alternating bouts of believing that he was brilliant and that he was incapable of fulfilling his own idea of greatness.

So it was no surprise that Walsh instantly regretted retiring. Believing that he left at least one Super Bowl on the table, Walsh was "melancholy and terrible," according to Craig. That the 1989 49ers were more dominant in the playoffs under new coach George Seifert than they ever were under Walsh made it worse. Walsh hated that Seifert won a championship that year with his team, his West Coast offense, his philosophy; he so hated the ring that the team awarded him that he gave it away. "He didn't want them to win," Craig says. "He couldn't hand over the team he had created to someone else, because he wasn't capable of it."

He tried broadcasting but quit in 1991. "I'm not going to sit for three hours and let some 27-year-old f-- in my ear tell me about the game," he told Brian Billick, former Ravens coach and one of his many protégés. In 1992 Walsh returned to Stanford, where he had coached in the '70s, but left after two losing seasons in three years, his magic gone. "He needed to be Bill Walsh," Billick says. "He needed to be a genius."

So he decided to write a book.

Walsh's tome has team lectures that deal with everything from malcontent agents to not thinking of opponents as personalities.

Pat McDermott has a dream: He wants to coach in the NFL. He is 26 years old, with bulky shoulders, a round face and an eagerness in his blue eyes that shines in the ravenously ambitious. He is in his first job, coaching running backs at the Episcopal Academy in Newtown Square, Pa. Like all coaches, he is drawn to football's impossible challenge, to somehow perfect a series of collisions on each snap into something as coordinated as a symphony. He was drawn to that challenge as a running back, first as a Pennsylvania prep standout and later at West Chester University. After graduating in 2009 with a business degree, he decided to make football his career.

In 2010 McDermott called Andy Reid, the then-Eagles coach now with the Chiefs whose sons he had played high school ball with, and Reid gave him an internship during the following summer's training camp. His tasks were menial -- organizing the coaches' dorm rooms and driving staffers around -- but offensive line coach Howard Mudd and offensive coordinator Marty Mornhinweg recognized a precociousness in him that once lived in themselves. They invited McDermott to join their early-morning and late-night film sessions. McDermott watched them obsess over the game's never-ending details -- a quarterback's footwork, a guard's hand placement -- and realized that if he wanted to be an elite coach, he needed to learn to think like one.

Last spring he heard about a book written by Bill Walsh that supposedly had a cultlike following among coaches. McDermott searched online and found two books authored by Walsh. One, called The Score Takes Care of Itself, was $13. The other, Finding the Winning Edge, cost a minimum of $100, with special leather-bound, signed editions fetching $1,000. It had been published in 1997 and was no longer in print.

McDermott, earning $2,000 a year at Episcopal Academy and working part time as a personal trainer, bought the cheap one. It was a breezy leadership read, not a hard-core football tome. A few weeks later, McDermott pulled up Finding the Winning Edge and skimmed the reader reviews. "Walsh goes through football from A to Z. Everything, and I mean everything that you would ever want to know about football ... Walsh fleshes out ALL of the details of all of his philosophies on how to run a football organization from management to players ... This book is a NFL Head Coach's blueprint, bible and handbook ..." McDermott purchased it, joining Bill Belichick, Urban Meyer and hundreds more coaches who have it on their shelves. As Billick says, "I don't sit in an office at an NFL facility where I don't see a copy." Last August, interning for the Eagles again, McDermott dived into it, unaware that he had bought a manual for ruining his life.

WALSH BEGAN WRITING alone at his beach house in Monterey, Calif., always at 8 a.m., on yellow legal pads, in pencil, in all caps, his penmanship so clean that it could be its own font. He would tear off sheets and stack them neatly in piles on the floor. This was in 1995, and Walsh didn't know what kind of book he wanted. A leadership guide? A playbook? A coaching manual? A blueprint for front offices? Walsh told Craig he wanted it to be a "real football book," not some light autobiography, waxing poetic about Super Bowls and Montana-to-Rice touchdown passes. He wanted his first book to motivate coaches, not delight fans. The truth was that a career that began in 1956 as a graduate assistant at his alma mater, San Jose State, almost ended many times. He was fired as Cal's offensive coordinator in 1963 because the team didn't win. He resigned as the Raiders' running backs coach in 1966 after one season because the grind overwhelmed him. Owner Al Davis expected coaches to work until he called to allow them to go home for the day. After a few too many nights of Davis not calling, Walsh quit and applied to Stanford business school, ready to leave coaching forever.

What haunted Walsh went deeper than pink slips and long nights. It was his drive to be great at something he couldn't control. His colleagues recall him as the most intelligent coach they'd ever seen, which Walsh not so discreetly agreed with. But he could be sensitive to the point of devastation, crushed by failures large and small. It began in high school, when his coach moved him from quarterback to running back. It continued when he wrote his master's thesis at San Jose State and the 192 pages on the evolution of the passing game in football was panned by professors. The only reason he graduated, according to biographer David Harris, was that his paper included only one footnote; he had done most of the original research himself. And he couldn't get out of his own way during his first head coaching job, at Washington High in the East Bay in the late 1950s. He refused to throw to his best receiver for fear that the team would score too quickly and rob him of the chance to test his new plays.

Aspiring NFL coach Pat McDermott dived into the book, unaware that he had bought a manual for ruining his life.

But Walsh was back within one year. While Walsh's business-school application was being processed, legendary coach Paul Brown, on the recommendation of others, offered Walsh a job coaching tight ends with Cincinnati. Walsh accepted, and three years later, in 1971, he took over the offense, which had been limited by a weak offensive line. Altering the concepts he'd learned in Oakland -- attacking defenses vertically with five receivers -- Walsh devised a system of short, quick passes designed to pick up small chunks of yardage, the West Coast offense in its infancy. Over the next few years, as Walsh turned Ken Anderson into one of the league's most accurate passers, the system worked so well that Walsh began to think he could do something no coach had done: conquer the game itself. His offense became so precise that it couldn't be stopped when executed perfectly, so Walsh became obsessed with always executing perfectly. "It would grind on him," says longtime friend Dick Vermeil. "He was so perceptive and detailed and emotional, and he put so much of himself into a game plan, that he took it personally if it didn't work."

And he took it personally when his brilliance was ignored. He constantly bumped heads with Brown, who was smart enough to keep Walsh around while at the same time -- Walsh believed -- blackballing him from becoming a head coach elsewhere by tainting his name to owners. In 1976 Walsh left Cincinnati to become the Chargers' offensive coordinator. One year later, he got a chance to be a head coach, at Stanford. After the 49ers hired him in 1979, Walsh won a total of eight games in his first two seasons. Ridiculed in the media, he grew so despondent that he considered resigning, convinced he didn't have the answers. Even after Walsh turned an inconsistent Notre Dame quarterback named Joe Montana from a third-round pick into a future Hall of Famer, winning Super Bowls in 1981 and 1984, he felt more angst than validation. "Bill had to prove himself to himself all the time," Vermeil says. "His past success could never overcome a recent failure, and nothing was enough to fill that little hole in his personality."

So he took the technocratic obsession that led to the West Coast offense and adapted it to the entire franchise. As president, GM and coach, Walsh would devise game plans, negotiate with agents, interview secretaries for jobs, instruct marketers, everything. As his offense became the offense around the NFL, opponents marveled at and then copied the so-called 49ers Way. But it was really the Walsh Way, a system flowing from one man's ingenuity and insecurity. By the late '80s, as Walsh's definition of success became so narrow as to be unattainable, the Walsh Way started to cripple the coach. He would sit dazed in his hot tub even after wins, despondent that he had miscalculated a play or two. "I was a tortured person," Walsh later told biographer Harris. "I felt the failure so personally ... eventually I couldn't get out from under it all. You can't live that way long. You can only attack that part of your nervous system so many times."

At his beach house in 1995, surrounded by rising stacks of legal paper, he was training others to attack theirs the same way. Walsh wanted to include everything. In the '80s, he had written job descriptions for everyone in the organization, from the GM to the executive assistant. Those had to be included. So did some of his classic West Coast plays, like 22-Z In, the slant pattern that became the NFL's most unstoppable play. So did his team speeches. He had videotaped most of them over 10 years, using them as a reference and an archive, and hired Craig to transcribe them. Craig spent eight hours a day in front of a VCR, staring at grainy footage, a glimpse of a man whom he seldom saw as a child and struggled to understand as an adult. Walsh had a solution for every situation, from planning pregame meals to always calling basic plays in the tightest situations to give the players confidence. "You realize how complex of a man he was to have all of this going through his brain," Craig says. "How could he have ever relaxed? He didn't."

Craig transcribed the speeches in a month. His dad promised to pay him but never did. Those papers became another pile on Walsh's floor. Craig said, "Dad, you have too many notes."

"No," Walsh said. "You have to understand all these components to get a full understanding."

"Have you read any other sports books?"

"It's not a sports book," Walsh snapped back. "It's a thesis."

At first, McDermott tried to read Finding the Winning Edge cover to cover. But he quickly discovered it's not meant to be absorbed that way. Belichick once referred to it as football "literature," but it's more like a textbook -- 550 pages, 1.8 inches thick, 3.2 pounds, loaded with charts, graphs and bullet points. For example, Walsh includes 57 keys to negotiating contracts ("The negotiator's need for food and sleep can affect his/her ability to function effectively"), 13 pages of sample practices and 108 in-game scenarios.

Its humor fails. "The fundamental goal of passing the ball is to make sure it's caught ... by the intended receiver." Some of the wisdom is painfully obvious. "A quarterback should lead by example." But McDermott understood why Belichick calls it a bible. In a secretive profession, it shows how a legend thinks. It teaches a coach to view the game from 30,000 feet and from the sideline. It provides the tiny details that add up to a philosophy for building a team, winning games and running a franchise. Mostly, it can lure a coach into the illusion that if all the steps are followed, perfection can be attained.

McDermott finished it in a month. Now he revisits it weekly. On this September Wednesday, he's worried that his players will become overconfident. Episcopal Academy is 3-0, outscoring opponents 134-0. Saturday night the Churchmen play Hill School, a rival they should smoke. McDermott is haunted by the specter of a meltdown. So what would Walsh do? McDermott turns to a section titled "An Extended Winning Streak." "Overconfidence can have disastrous consequences if your players feel that they ... have already mastered the basic fundamentals."

McDermott has always been a perfectionist. But since he became a coach, everyone has told him that success requires that instinct to be amplified. Sometimes McDermott pauses to consider the costs of that mentality, but ambition usually overrules. So he flips to Chapter 11, "Preparing to Win." "The core of any type of detailed preparation is the need for maximizing meaningful repetitions ... A 'wasted' rep is a lost opportunity that will be very difficult to make up later."