The weekend before last I did a 10-mile run. Under normal circumstances, such a workout is no big deal, but I am coming back from an injury and this one did not go terribly well. Having done a succession of eight-mile runs every other day over the preceding week, I was hoping to feel comfortable, both fitness-wise and pain-wise, going a little faster over a slightly longer distance in this particular session.

This didn’t seem like too much to ask. Having averaged about 8:15 per mile in my last eight-miler, I was hoping to knock that down to 8:00. But as it turned out, my groin let me know in no uncertain terms that going any faster than 8:20 per mile would be dangerous. And while it certainly was not a strain to maintain this pace, I felt as though I were running quite a bit faster. I kept glancing at my watch, convinced I was speeding up, only to find that I wasn’t.

In the face of my thwarted expectations I became frustrated and began to contemplate cutting the run short. Accustomed to completing 10-mile runs in 75 minutes or less, I almost couldn’t bear the thought of needing a full 10 minutes more to slog through this one. My mood turned dark, my self-talk negative. But then something happened. One moment my consciousness was wholly absorbed in these dark emotions and negative thoughts. The next moment I was mentally removed from them, observing them from a separate level of consciousness. This new perspective allowed me to judge them for what they were—unhelpful—and intentionally choose alternative emotions and self-talk.

I chose, specifically, to be grateful that at least I was able to run, however slowly, whereas just a few weeks ago I was unable to run a step without significant pain. I told myself to embrace the necessity of going slow for now, reminded myself that today’s restraint would be rewarded tomorrow (or eventually). Like a pedestrian dodging raindrops to who discovers the futility of staying dry and begins dancing through puddles, I suddenly went from being irritated the large numbers on my watch display to being amused by them. The second half of the run was infinitely more enjoyable than the first.

This little anecdote is an example of metacognition, or thinking about one’s own emotions or thoughts. This (almost) uniquely human capacity plays an important role in endurance training and competition. Some athletes are more skillful users of metacognition than others, and those who use it well are able to control their thoughts and emotions in ways that enable them to make better decisions and perform at a higher level.

As athletes, we tend to regard our thoughts and emotions as effects of how the body is feeling and performing. If you feel lousy and are off pace at the midpoint of a 10K road race, for example, you are likely to experience negative thoughts and emotions as a result of your bodily situation. But research has shown that the causal loop goes both ways—that thoughts and emotions also affect perceptions and performance. A 1988 study by Damon Burton at the University of Idaho identified a strong negative impact of anxiety on performance in swimmers. And a 2013 study by Samuele Marcora at the University of Kent found that two weeks of training in positive self-talk increased performance in a time-to-exhaustion test by 17 percent.

What makes metacognition so powerful is that it allows us to choose our thoughts and emotions to some degree. Without it, your mind is totally at the mercy of your body. Only by taking a mental step back from the present contents of your mind can you clearly see what’s going on and actively choose more helpful thoughts and emotions.

Like any mental ability, metacognition comes more easily to some than it does to others. But anyone can develop it through practice. That’s what mindfulness meditation is all about. There are other ways, though. Indeed, it’s enough just to start every workout and competition with the intention of “catching” negative thoughts and emotions and choosing more helpful alternatives. Initially, you may find yourself brooding on a negative thought or feeling for a while before you snap awake and take a mental step back from it, and even then you may struggle to find a helpful alternative (for you cannot simply lie to yourself, saying, for example, “My foot doesn’t hurt” when in reality your foot doeshurt), but with practice you’ll get better and better at this process.

Another personal example of metacognition at work—and one where there was a lot more at stake than in the previous example—is something that I experienced during Ironman Wisconsin back in 2002. My lowest moment of that race was the first few strides of the marathon. I’ll never forget the fear and dismay I felt when I discovered that, with 26.2 miles of running ahead of me, my legs were as battered and depleted as they had been when I finishedmy last standalone marathon, perhaps more so, as the damage resulting from a severe calf muscle cramp suffered two minutesinto the swim had, during the bike leg, morphed into a pins-and-needles sort of pain affecting almost the entire front leg. I thought, ‘How the hell can I possibly do this?’

But in the next moment I took a mental step back and reminded myself that I was hardly the first athlete in this position, and that I had prepared for this race in more or less the same way thousands of others had done before me, athletes who had grinded through the discomfort I was feeling now and finished strong. And that is precisely what I proceeded to do, even pulling off the relatively uncommon feat of even-splitting the marathon, the mantra Trust your training looping through my head the whole way.

That’s metacognition for you!

Here is an interesting scientific paper on the role of metacognition in endurance performance.