Last year, I started experiencing symptoms such as bloating, gas and loss of appetite. It turned out to be an unusually long bout of sickness for a normally healthy person like me. After reading a dozen articles online about the symptoms, I began to wonder if I had cancer or another disease.

I shared my concerns with my father. He is a doctor who treats people with cancer. He asked me to “eat more fiber.” I was disappointed he didn’t take me seriously. After spending a few days obsessing over cancer and death, I finally saw a doctor specializing in disorders of the digestive system.

The doctor, an experienced professional well into his 60s, listened intently to my whining. He quickly diagnosed me with acid reflux, a condition in which a muscle that connects the stomach with the food pipe becomes weak. Consequently, the stomach’s acid flows back into the food pipe.

The physician did not sound alarmed and asked me to take some basic precautions—”avoid coffee and don’t add too many spices to food.” I took the meds he prescribed, and I was back to feeling healthy in a week.

This wasn’t the first time I had succumbed to the trap of overthinking. Determined to understand the problem, I decided to speak to psychologists and learn why we are prone to thinking too much.

Why does overthinking happen?

Everyone overthinks sometimes. But some people do it more frequently than others. Some of these individuals could have anxiety disorders, but not everyone does. “There are people who have levels of overthinking that are just pathological,” says clinical psychologist Catherine Pittman, an associate professor in the psychology department at Saint Mary’s College in Notre Dame, Indiana. “But the average person also just tends to overthink things.” Pittman is also the author of “Rewire Your Anxious Brain: How to Use the Neuroscience of Fear to End Anxiety, Panic, and Worry.”

Chicago-based clinical psychologist Helen Odessky, Psy. D., shares some insight. “So often people confuse overthinking with problem-solving,” says Odessky, the author of “Stop Anxiety from Stopping You.” “But what ends up happening is we just sort of go in a loop,” Odessky says. “We’re not really solving a problem.”

Overthinking is rooted in uncertainty. “Because we feel vulnerable about the future, we keep trying to solve problems in our head,” says David Carbonell, a clinical psychologist and author of “The Worry Trick: How Your Brain Tricks You into Expecting the Worst and What You Can Do About It.”

Picture this: you’ve had a fight with your boss. You start to freak out and tune into the worry channel. Your thoughts go in a loop like this: What if he fires me? I was really hoping to buy a house this year. What if I don’t get another job? What if this destroys my career? It can really take off.

What’s going on inside your head?

The process of overthinking is not really clear to scientists. But it probably engages the same parts that are involved in anxiety and fear. The cerebral cortex is the seat of all thinking. “It’s the logical part of the brain that can bring up memories and help us think about and anticipate things,” says Pittman. But if you let yourself obsess about something—say, whether your sister is mad at you—you will soon have amygdala’s attention. It’s the brain’s emotional center and research has found it to be involved in anxiety and fear. That’s when things get dramatic. “The amygdala makes our heart pound, says Pittman. “It makes us feel uneasy and gives us muscle tension.”

She explains that the more you worry about something, the more you train your brain to think about it—and the more you activate the amygdala. It can become a vicious cycle, and you could put yourself at risk of anxiety disorders in the future.

Trick your brain

Overthinking is like a vacuum of some kind—it sucks you in. “It removes us from active participation,” says Carbonell. “The more we are engaged in overthinking, the less are we actually doing things in the physical environment.”

But it’s possible to defeat this pattern of thinking and win your life back. Pittman has a startling suggestion. “Telling yourself to not to have a certain thought is not the way to not have the thought,” she says.”You need to replace the thought.” What if she were to tell you to stop thinking about pink elephants? What are you going to think about? That’s right: pink elephants. If you don’t want to think about a pink elephant, conjure up an image of, say, a tortoise. “Maybe there’s a big tortoise holding a rose in its mouth as it crawls,” says Pittman. “You’re not thinking about pink elephants now.”

She also asks her clients to set aside some time for the obsessing later. “I often tell them: Can we schedule a time for you to worry from 4 to 5 p.m. and that’s all you do during that time?” Pittman says.

You can always go back to the topic of overthinking later if it really needs to be addressed. Then you can make a plan to deal with it. Once you have a plan of action in place, you will be less likely to be tempted to go back to the original worry.

Talk yourself out of it

Becoming self-aware can go a long way in helping you deal with overthinking in the long term. Carbonell suggests a strategy. “Pay a little more attention,” he says. “Say something like: I’m feeling kind of anxious and uncomfortable. Where am I? Am I all in my head? Maybe I should go take a walk around the block and see what happens.” You have to recognize your brain is in overdrive mode, and then try to snap out of it. “Do something in real time and real life rather than sitting and thinking,” says Carbonell.

Moreover, in these turbulent times, it can be impossible not to spend an inordinate amount of time stressing about the state of the world. But let’s face it: some problems are better left for others to solve. Ask yourself: should you really be mulling over this specific problem? “Is there going to be a nuclear attack? Unless you work at the Pentagon, you don’t need to solve that problem,” says Odessky.

Just remember that you won’t overcome the habit of overthinking in a few days. But with repeated practice, you will teach your mind to be calm during times of stress and not go into overdrive.