How many times have you asked yourself, “What could go wrong?” before letting your mind spin out a dozen potential catastrophic failures?

I do this all the damn time.

Yes, I’ve spent the better part of my adult life working on myself—mind, body and spirit. I exercise. I do breathwork. I watch what I eat. When I go on assignment in an exotic, dangerous locale, I do my homework. I plan ahead. I minimize risk out the ying-yang. And still I wake up in the middle of the night wondering what I missed. There must be more I could do.

But there’s one irreducible truth to every human endeavor: risk is risky. We can never iron out all the wrinkles in this life. Nothing is actually easy. Which has led me to this blanket conclusion: How we resolve the tension between risk and reward defines who we are. And fear is a guidepost for how we use what I call “the wedge”—or the ability to separate out stimulus that we get from the outside world from our built-in automatic responses. Fear is as much an involuntary response to a prediction of the future as it is a sensation that immobilizes our biology and stops us from taking action. Mastering fear doesn’t mean ignoring danger, but rather finding a reason that makes danger worth it—separating the stimulus from the response. More important, the way that our brain encodes fear gives insight into everything we sense, feel, and react to.

About ten years ago, I was reporting a story from a jungle in central India about a war between the government and communist insurgents that had raged on almost since the country’s independence. A day earlier, child soldiers with automatic weapons and bows and arrows held me up at a roadblock, but now I was sitting across from an Indian colonel, who informed me that he was planning a raid on an enemy encampment. It sounded like something I should be there for, so I asked if I could come along. He said yes but advised me that there were certain risks I would have to be willing to take.

First, it would be a long hike over grueling terrain.

I was okay with that.

Second, the army wouldn’t be responsible for my safety when the shooting started.

That sounded a little dicey, but I figured I could stay far enough away from the bullets. Maybe I’d hide behind a tree.

Third, there would probably be land mines.

My heart dropped into my stomach. I started to sweat. My mind spun out a vision of the future where an errant footstep and explosion ripped off my legs and sent shrapnel through my guts. There would be an airlift, a mournful return home, and years of rehabilitation without prognosis for recovery. I felt queasy. Terrified. I didn’t know it before he said it: bullets and exhaustion were one thing, but land mines were a bridge too far. I’d be happy to read a report about the raid later.

Outside Podcast: Play this episode. You can also subscribe to our podcast here.

Over the years, I’ve done a lot of dangerous things. Maybe I’ve been lucky to escape with my skin intact. But how is it that I can look at one threatening situation with a shrug and then want to hide under my bed when the stakes change just a little bit? Some alchemy must happen at the neurological level that makes abstract ideas into things I can feel in the pit of my stomach. I want to know what process my brain and nervous system go through to transform a sensation into a thought. Where’s the interface between neurology and experience? And how might I use fear as a wedge? I realize I am going to have to call in an expert.

A few years ago, I had a conversation with a neuroscientist at Stanford named Andrew Huberman, who had set up a laboratory to study the complex neurology of fear. He was unlocking the mysteries of how our brain encodes sensation and visual stimuli as visceral emotional responses. More specifically, he was looking at how people responded to suddenly being face to face with great white sharks. What could be scarier, right? I called him up again and made plans to meet him at his Palo Alto laboratory. I had a gut feeling Huberman could teach me a lot about how my brain builds automatic assumptions about the world.

A few weeks later, we’re sitting in a trendy restaurant a few blocks from where Steve Jobs lived while building his Apple empire. The menu boasts enough salad bowl varieties to match any fad diet. As we crunch our lettuce and sip iced tea, I am struck that Huberman looks more like a mixed martial arts fighter than a neuroscientist: He’s tall, with dark hair and a rigid chin line and muscles bulging through a Henry Rollins–esque black jacket. Tattoos cover most of his body below his neckline. I begin with the most basic question I can think of: “What is fear?”

Instead of answering directly, Huberman breaks into a story about an experience he had a few weeks earlier while running one of his fear-based experiments. He knows he’s got a good yarn to spin, because this time his life was on the line.

Huberman was about 40 miles off the coast of Mexico and 40 feet below the periwinkle surface of the ocean. Above him, a boat packed to the gunwales with state-of-the-art camera and diving gear was his laboratory on the sea. He was here to collect footage of some of the largest predators on the planet in order to reproduce them in a virtual reality simulator back in his lab. But something was wrong, and it wasn’t just the great white sharks circling his cage. Huberman couldn’t breathe.

A long air tube called a hookah line snaked from the boat to the Stanford-based neuroscientist’s mouth. Somewhere along the way, it either kinked onto itself or the pump that forced air through the tube stopped working. Either way, Huberman knew he didn’t have much more than 40 seconds at most. So he leaned back on his training, cleared his mind, and tried to think his way out of the situation before he ended up gulping down an ocean of water.

The shark cage was a rectangular steel box about five feet wide at the base and eight feet tall. At opposite corners of the cage, two backup tanks carried about ten minutes of air for emergencies like this. Huberman reached down and put his mouth on the regulator of the first tank. Nothing. He tried the gray metal knob on one canister, but it refused to rotate, as if a pin was locking the mechanism. The other tank offered the same result. With no time to wonder why the backups weren’t working, he pushed off the metal floor and carried himself to the top, where he tried to shake the hose free. Still nothing. He drew on the tube again, but all that did was create a little reverse suction, pulling his tongue gently into the aperture. Things were starting to get scary.

Outside the box were at least six great white sharks between ten and 17 feet long; some weighing as much as 3,000 pounds swam by. While the team knew about the nearby sharks, no one had an exact count on how many hid in the haze just out of range. Huberman locked his eyes on one ancient battle-scarred monster, his brain somehow recording the shark bites that marred its sandpaper skin as it swam toward him. A flick of its tail sent it careening past a diver who was bravely recording the encounters with a special 360-degree camera but had his back to the cage.

Twenty or 30 seconds had passed since Huberman’s last breath. The frothy sensation of panic began to well up in his gut, threatening to take him out of the moment and squander any hope of escape. While his life hung in limbo, the wrinkled face of his bulldog, Costello, filled his mind. It was a bit of a non sequitur, a brief interlude in the moment of high drama. But Huberman remembers focusing on his pet and thinking, “I’m going to make it back home to him.”

Between thoughts of Costello and being ripped apart by sharks, Huberman took a moment to assess his options. He had two: he could exit the top of the cage and make a sprint to the surface, or he could try to get the attention of one of the other divers, share their air, and buy time. The second option was better, but no one was looking in his direction. Huberman wrapped his fingers around the hatch above him and tried to calculate his chances of escape. Getting to the surface might not be hard by itself, but the sharks made the errand more complex. Divers who remain calm attract less attention than those who panic. Rapid breathing, fast movements, and the hidden signals we all give off when we’re frightened can trigger a predator’s hunting response, which can transform an unappetizing neoprene-clad diver from a curiosity into prey. Dashing to the surface right then meant that Huberman would not only be fighting his urge to breathe but possibly also racing away from a creature that can reach bursts of speed over 35 miles per hour.

“Maybe I can go when they’re not looking,” Huberman thought. It was a risky move. If one of the great whites caught sight of him—a likely occurrence since they have panoramic vision—his last sensation could well be teeth ripping through his wetsuit. On the other hand, there weren’t many other options.

Huberman steeled himself for the rapid ascent, picturing the movements his fins and arms would have to make during the sprint. Then, by chance, his friend—who had spent ten years organizing shark expeditions—followed the path of the battle-scarred shark, passing him so that the cage entered his field of view. In a moment of brief communication, Huberman ran his finger across his throat—the signal for being out of air underwater. The dive organizer put his hands up in a shrug, as if to ask, “How is that possible?” Huberman symbolically cut his own throat again. Convinced of the emergency, the other diver swam over, removed his regulator, and shared it with Huberman. Another ten seconds and the situation could have ended in tragedy.

The two men slowly ascended to the surface together, making subtle deliberate movements until their heads broke the surface.

Once he was safe and in the boat, Huberman says, another friend of his on the expedition, a former Navy SEAL, gave him a wry grin.

“So, what did you learn?” the friend asked.

I look across the table at him expectantly. “Yeah, what did you learn?”

And then Huberman answers my question.

At one level, he says, fear is a specific type of arousal in the brain stem characterized by the secretion of adrenaline, and then discomfort and perhaps a dash of confusion. I can see that he thinks his first attempt at an answer is not quite good enough, so he tries again. “It’s the anxiety that you feel when you don’t know what behavior can remove a feeling of helplessness in the face of a threat.”

Twenty or 30 seconds had passed since Huberman’s last breath. The frothy sensation of panic began to well up in his gut, threatening to take him out of the moment and squander any hope of escape.

He’s obviously having trouble pinpointing such an obvious yet ephemeral concept. But he’s landing on the same interfaces of the wedge: there’s external stress, a sensation he can feel in his body (anxiety), and an orientation to the threat.

Huberman goes on to recount that it wouldn’t have helped him to spend time thinking about all the ways he might die. He was too busy to contemplate alternative endings. Instead, he had to remain calm and problem-solve his way out of the situation. “I still had options,” he says. Fear would have meant he was out of control. No choices. So maybe he wasn’t exactly afraid in the moment. It was something else.

Huberman decides to paraphrase the great horror writer Stephen King: fear has a lot to do with time frames. Before the event, a person experiences the dread of anticipation; during the event, there’s terror when they’re helpless in the moment; and after it’s over, a person remembers the experience as horror.

In fact, if you can think back to any Stephen King book (or, for that matter, anything in the horror genre), we experience fear more as anticipation than anything else. The buildup to a scary clown lurking in the sewers creates more emotional resonance than the actual moment it grabs you.

As I listen, my mind wanders back to my battlefield experience in India, and I realize that it was an entirely different type of fear than what Huberman went through. In the dread-terror-horror continuum, I felt dread as I anticipated the possibility of stepping on a land mine in India. But for Huberman, the danger was so immediate that actual fear didn’t have time to enter the picture. It’s only after the event that the story evokes something powerful: a sense of horror when we look back and anticipate what might have gone wrong. In both cases, however, the danger demanded a particular type of mental state to avoid fatal consequences, wedging open a space between stimulus and response. Maybe this is why some people enjoy the anticipation of dread that builds up in a horror movie. They’re in a safe space, but they identify with what they see on screen in a way that tickles their innate anxiety.

But the real question is: what can we learn from fear? How can we use it to redefine the space between risk and injury? How can we make it into a wedge that makes us better able to act in the world instead of retreating from the dangers life throws at us?

Scott Carney is an investigative journalist and New York Times bestselling author.

Buy the Book