Adopting a healthy diet and exercise regimen is essential for maintaining weight. And, according to a new study from Stanford University School of Medicine, people need to focus on both of these simultaneously to achieve better, long-lasting results.

"It may be particularly useful to start both at the same time. If you need to start with one, consider starting with physical activity first," said Abby King, PhD, a professor of health research and policy and of medicine and lead author of the study in a news release.

People in the U.S. are advised to get at least 2 hours and 30 minutes (150 minutes) of moderate physical activity a week along with muscle strengthening exercises two or more days a week, according to Centers for Disease Control and Prevention (CDC). However, people find it difficult to get the recommended amount of physical activity due to busy lifestyles and social engagements.

The study was based on data from 200 participants who were aged 45 years or older. Researchers first split these participants into four groups; the first group was asked to change diet and exercise pattern; the second group was asked to change diet, but not exercise; the third group had to change exercise habits, but not diet; and the fourth group was asked to make any changes in diet or exercise pattern, and acted as the control group. All the participants were tracked for about a year.

Researchers found that people who focused on diet and exercise simultaneously were able to better stick with the changes after a year than people who made changes to their diet or exercise. The first group that required changing both exercise and eating habits initially found it difficult to manage weight due to busy schedules. However, researchers found that this group got particularly better at controlling both diet and physical activity levels over the course of the study.

"These health behaviors aren't things that we change over a six-week period and then our job is done. They're things that people grapple with their whole lives, so to develop 'touches' of advice and support in a cost-efficient way is becoming more and more important," King said.

The study is published in the journal Annals of Behavioral Medicine.