While the season isn’t technically over until the end of September, Labor Day weekend marks the summer’s symbolic close. After three months of warm, balmy bliss, suddenly students have to shift their brains back into learning mode and professionals have to shake off the daze of that final, glorious three-day weekend.

Luckily, there are ways to hack the body and mind to get yourself back into the work groove.

Enhanced productivity comes from “making certain choices in certain ways,” writes Charles Duhigg in his book Smarter, Faster, Better, explaining that success is all in the mind. Studies show that when people feel their destiny is in their own hands, they’re more likely to have high academic success, greater social maturity, and better self-motivation. That’s because that mindset leads them to believe they have the power to influence their success, and so they set higher goals for themselves — and often meet those goals.

Once a person decides that they are self-reliant, then they can maximize the productivity-boosting opportunities offered by other governable factors like sleep, diet, mental exercise, and physical health. Your brain may feel blah after time off, but there are scientifically backed ways to recharge it.

Get your brain out of vacation mode.

Be Smart About Your Sleep

Locking down grade-A sleep is crucial to getting good grades. According to the National Heart, Lung, and Blood Institute, a good night’s sleep helps with learning, paying attention, making decisions, and creativity. It isn’t exactly clear how sleep has such a restorative effect on the body, but scientists do know that it has something to do with cerebrospinal fluid moving through the brain through blood vessels during shut-eye, which is thought to drain toxins from the brain that build up during the day. Losing sleep, even if it’s just a few hours a night, trips up this process — and the effects can carry over at work or school.

According to a 2015 study conducted by the National Sleep Foundation, how much sleep you need to function well depends on how old you are and your genetic makeup. While school-aged children need nine to ten hours of sleep, teenagers can do with an hour less. Adults, meanwhile, need between seven and nine hours of sleep.

There’s no objective optimal bedtime for humans: Your natural sleep cycle should determine what time you should go to bed. Ultimately, your quality of sleep is more important than quantity of sleep, and figuring out how to optimize that means knowing your own physiology. In general, going to bed between 8 P.M. and 12 A.M. puts you in a sweet spot that ensures your brain will get the amount of REM sleep it needs to be fully functional. But night owls shouldn’t make themselves hit the hay early: Dr. Allison Siebern, associate director of Stanford’s Insomnia and Behavioral Sleep Medicine Program, told Time in 2014 that going against physiology means that a person won’t get the quality sleep they need.

You have to exercise your brain. 

Maximize the Potential of Mental Exercise

Cognitive psychologists believe that a person’s ability to retain, recall, and use knowledge to solve problems is dependent on how that knowledge is stored as a memory. Specialized memory training techniques, known as mnemonics, can help boost that ability.

One particularly successful mnemonic device is called the “method of loci”, which is also known as building a “memory palace”. This technique involves creating spatial relationships between particular locations and things you’re trying to remember: For example, if you wanted to remember key points for a big work speech, you would mentally place each point near an item in your living room — the budget numbers on the sofa; new quarterly initiatives on the ottoman. A 2014 study in Advances in Physiology Education found that every participant that used this strategy called it a “helpful technique.”

A study published in Neuron earlier this year demonstrated that people who were “loci trained” were able to remember 50 percent more words than their untrained counterparts — and that their brain connectivity patterns were different as well. After training, participants’ brain scans looked quite similar to those of “memory athletes.” These people who actually participate in memory competitions. These people don’t necessarily have a higher intellectual ability than other people, but the parts of their brains involved with spatial memory and navigation have been shown to be more engaged. That’s good news for the rest of us: Memory isn’t a given, and your success at work or school can be amplified by some mental training.

Design Your Diet Strategically

Science has shown that “brain food” is a real thing. In a review of 160 articles published in the National Review of Neuroscience in 2008, University of California, Los Angeles neurosurgeon Fernando Gómez-Pinilla, Ph.D. argued that people looking to up their brain’s ante should consume foods rich in omega-3 fatty acids, like cold-water fish, whole milk, kiwi fruit, and beef from grass-fed cows. Omega-3 fatty acids, he wrote, help improve memory and learning skills, and they assist the brain in fighting disorders like depression, schizophrenia, and depression.

Controlled meal-skipping and caloric restriction can be helpful for the brain, he added. Excess calories cause brain synapses to be less flexible and make cells more vulnerable to damage because they lead to the formation of harmful free radicals. In other words, a bad thing to eat before a big test or meeting is something rich and calorie-dense, like a steak: The meat is full of saturated fat, which studies have shown causes people to perform worse on memory tests.

Pick Up the Pace With Exercise

Mental exercise helps strengthen the brain, but physical exercise helps strengthen your cognitive power as well. Exercise boosts the brain and enhances positive mood — but what exercise you choose makes a difference. A 2014 study by University of British Columbia researchers found that regular aerobic exercise like cycling, swimming, jogging, and dancing, increases the size of the hippocampus, the part of the brain linked to verbal memory and learning. Meanwhile, resistance training and muscle toning exercises didn’t affect learning skills as directly (though they still helped the brain grow new blood vessels).

Regular exercise also increases blood circulation, which helps depression, calm the body, and reduce anxiety. The effects can be immediate: According to the American Psychological Association, mood can be positively enhanced within just five minutes of moderate exercise. That means for everyone trying to get over that summertime sadness, it’s time to lace up: The best thing to do is jog to work, even if you’d rather drag your feet.

This article, originally published on August 30, 2017, has been updated.