There are many things you can eat — like blueberries and avocados — and do — like aerobic exercise and yoga — that can help keep your heart healthy. But none of these healthy practices are going to take place unless you're in the right state of mind. The best way to maintain good heart health is to stay positive, according to new research.

The study analyzed the mental health, levels of optimism, and physical health of 5,100 adults ranging from 45 to 84 years of age. Heart health scores — based on American Heart Association-approved metrics, including blood pressure and body mass index — increased right alongside optimism levels.

People who were the most optimistic were twice as likely to have ideal cardiovascular health, and 55% more likely to have a total health score in the intermediate range, the researchers found.

The findings held true even when the researchers factored in mental health status and socio-demographic characteristics such as age, race and ethnicity, income, education-level.

Optimists had significantly better blood sugar and total cholesterol levels than the more pessimistic participants. And it's no coincidence that they also were more physically active, had healthier body mass indexes, and were less likely to smoke.

"At the population level, even this moderate difference in cardiovascular health translates into a significant reduction in death rates," said lead researcher Rosalba Hernandez, in a press release. The evidence, she says, suggests that findings ways to improve peoples' psychological well-being would improve Americans' cardiovascular health dramatically.

Like many things in life, it's a cycle. If you're happy, you eat well and exercise, which keeps you healthy. And if you're healthy, you'll be happy. But if you're sad, you're not going to care as much about how you eat or how much you exercise — you can see where this is going. The best thing you can do for your heart is to keep your head up.