We’ve all been there: lying in bed after a long day, tired yet wide-awake. Our mind is racing. Perhaps we’re worrying about money, work or have been watching too much news.

Whatever the case may be, trying to fall asleep when your mind won’t quit is nothing short of maddening.

Why do anxious thoughts flare up at night and how can we combat them?

At the end of the day, the brain has nothing to keep it busy

During the day, we have dozens of tasks occupying our energy. Bedtime brings a halt in activity that can be a difficult transition for our brains.

“Anxiety piles up at night because anxious preoccupation is avoidable when a person is actively using their brain and body to carry them through the day,” says Dr. Kate Cummins, a licensed clinical psychologist. “When you have a list of to-dos or business meetings to participate in, your thought process is geared towards frontal cortex functioning, which is the judgment, planning and reasoning areas of your brain. Once you are finding yourself at the end of your day, your frontal cortex has the ability to relax a bit, shifting gears into things you enjoy or pieces of you that are not connected to higher level functioning, mainly in your emotions and limbic system. When your thoughts start connecting to the emotional part of your cognitive functioning, especially at night, the anxious thoughts or anxious emotion that has been lying dormant all day has a place to go, and becomes the forefront of your thinking patterns.”

How do we stop this vicious cycle? We’ve compiled a list of helpful tips in two parts: things you can do while in the grips of anxious thoughts, and things you can do to prevent them, before you go to bed.

What you can do when already in bed:

Identify the root of the anxiety out loud, and fight it with positivity

Once you're in the grips of anxious thinking, you have to work at clearing your mind by venting the nervous thoughts and replacing them with positive ones.

“First, decide what it is specifically that you are focused on that is causing you anxiety,” says Dr. Cummins. “Is it something that you have control over? Is it something in your future that has not yet occurred for you? If so, state the negative thoughts or anxious concerns out loud and then follow them up with alternative and positive thoughts or solutions for your problems.”

“You have to be able to soothe yourself out of the uncontrollable and irrational black or white thinking by combating it with alternative thinking — or it is impossible to avoid,” adds Cummins.

Visualize the good things in your life

The power of your imagination can help get you to a place of ease when you’re fretting.

“Visualization of positive events and relationships in your life will help you increase your connection to positive emotions that are also lying around within you, but you have to work at accessing them when the anxious feelings or thoughts have already shown up,” says Cummins.

Relax your whole body — including your face

Calming your body is integral to calming your mind.

Joy Rains, a certified life coach and the author of "Meditation Illuminated: Simple Ways to Manage Your Busy Mind", recommends a progressive relaxation exercise you can do in bed.

“Lie on your back and bring all your attention to your body,” Rains says. “Begin a process of gently tightening and releasing each muscle group, starting with your feet and working your way upwards to the top of your head. Hold each muscle as tightly as you can for about five seconds, then release it completely and see if you can notice the difference between the muscle tightened and the muscle relaxed. Move onto the next muscle until you've relaxed your entire body. Any time your mind wanders, gently bring your attention back to the tightening and releasing of each muscle group.”

I have found that this exercise helps, but I’ve been forgetting one crucial part of my body: my face.

“Focus on relaxing one's eyes and face — a common area overlooked when trying to relax,” says Dr. Paul Coleman, a psychologist, motivational speaker and the author of “Finding Peace When Your Heart Is In Pieces: A Step-by-Step Guide to the other side of Grief, Loss, and Pain”. “Imagine a simple relaxing scene to focus on. Keep going back to that image if your mind wanders.”

Make a pledge to accept uncertainty

Your anxiety may be tied to a problem that is understandably keeping you up at night. But you have to let it go if only for this moment.

“Repeat the phrase ‘I accept uncertainty for now. I will take action when action is possible’,” says Coleman. “Accepting uncertainty is crucial because otherwise one is resisting uncertainty at a time when resisting only adds to tension.”

What you can do before you go to bed:

Get your worries on paper (and out of your head)

Calming an already-stirred up mind can be challenging, so also implement some calming practices before you even get into bed.

Dr. Whitney Roban, a clinical psychologist and family sleep specialist’s number one piece of advice for people suffering from night-time anxiety is to keep a journal where you can write down all those clingy thoughts.

“When you get these thoughts out of your head and onto paper, there is a good chance they will not infiltrate your mind when it’s actually time to go to sleep,” Dr. Roban says. “Many people also like to make lists in their journal of the things they need to do the next day.”

Read, but not on your phone

Getting lost a book is beneficial for many reasons, and it can be pivotal to sleep health.

“Reading is a great way to quiet your mind and distract yourself from any anxious thoughts that might creep up at night. When you are engaged in a story, your thoughts are in the moment, instead of worrying about the future,” says Dr. Sal Raichbach, a licensed clinical social worker at Ambrosia Treatment Center. “On the other hand, the blue light emitted from cell phones does the opposite. Even if you turn down the brightness, blue light from LED screens interferes with the production of essential brain chemicals like melatonin that tell your body it's time for bed.”

Pick up a real book, and I recommend from extensive experience with insomnia, that you pick the densest, dullest tome in your collection.

Keep the bedroom chilled and completely dark

We may want to consider keeping our bedroom just a tad cooler than we like, and leaving any nightstand lights off. (This means doing your reading in another room.)

“Ensure your bedroom is quiet, comfortable, ventilated, dark and cool,” says Elaine Slater, a psychologist and psychotherapeutic counselor. “Even a small amount of light in your bedroom can disrupt the production of melatonin and overall sleep.”

Take a tip from your kids with a strict bedtime routine (and a bath)

“We know how important it is for children to have a nighttime routine as it creates a sensed of structure and security, well the same goes for adults especially if you suffer from anxiety,” says Bianca L. Rodriguez, a psychotherapist and spiritual coach. “A bedtime routine can help you self soothe and act as a container for your anxiety. I recommend taking a warm bath or shower before bed to relax your muscles as the state of your body impacts the activity in your mind. Imagining frustrations, negative energy or worries flowing down the drain can help you approach sleep feeling more clear and calm.”

Proactively reduce stress during the day

Sometimes our anxious thoughts are simply the remains of a stressful day.

By taking a positive approach to your day and doing as much as you can to eliminate stress, you can create a peaceful night.

“Some of the best ways to deal with anxious thoughts at night are to reduce the stress you have to deal with during the day,” says Benjamin Ritter, a coach and consultant specializing in personal and professional leadership development. “You can avoid stressful people, be more open and honest about your feelings, and most importantly plan and strategize areas of your life. Reduce the number of decisions you have to make during the day and you'll have more left over in your brain bank to deal with stress and anxiety at night.”

MORE WAYS TO REST BETTER

Want more tips like these? NBC News BETTER is obsessed with finding easier, healthier and smarter ways to live. Sign up for our newsletter and follow us on Facebook, Twitter and Instagram.