A plant-based diet and drinking coffee may both help to reduce the risk of heart failure, say scientists.
One study of five different kinds of diet found that people who ate a lot of fruit and vegetables were 42% less likely to develop the condition than those who consumed fewer plant-based foods.
Another team showed that increasing coffee consumption by one cup per week reduced the risk of heart failure by 7% and stroke by 8%.
Findings from both studies were presented at the American Heart Association's Scientific Sessions meeting in Anaheim, California.
Heart failure is a potentially fatal condition that occurs when the heart is too week to pump blood efficiently around the body.
The five diet types assessed in the first study were classified as "convenience" (red meats, pastas, fried potatoes, fast foods), "plant-based" (dark leafy vegetables, fruits, beans, fish), "sweets" (desserts, breads, sweet breakfast foods, chocolate, candy), "southern" (eggs, fried food, organ meats, processed meat, sugar-sweetened drinks), and "alcohol/salads" (salad dressings, green leafy vegetables, tomatoes, butter, wine).
Scientists recruited 15,569 participants for the diet study whose health was monitored for four years.
Lead researcher Dr Kyla Lara, from Mount Sinai Hospital in New York, said: "Eating a diet mostly of dark green leafy plants, fruits, beans, whole grains and fish, while limiting processed meats, saturated fats, trans fats, refined carbohydrates and foods high in added sugars is a heart-healthy lifestyle and may specifically help prevent heart failure if you don't already have it."
The coffee study involved a re-analysis of data from the Framingham Heart Study, a long-running US investigation of heart disease risk factors involving many thousands of participants.
It found that each additional cup of coffee drunk per week was associated with a lower risk of heart failure and stroke compared with no consumption.
The study was carried out using an artificially intelligent machine-learning system.
First author Laura Stevens, from the University of Colorado, US, said: "Our findings suggest that machine learning could help us identify additional factors to improve existing risk assessment models."
Victoria Taylor, senior dietitian at the British Heart Foundation, said: "Previous research has suggested that intakes of 3-5 cups of coffee a day shouldn't affect the risk of developing heart and circulatory disease.
"More research is needed before we can confidently say how coffee consumption may impact our heart health.
"Eating plenty of fruit and vegetables, cutting down on salt, and maintaining a healthy weight are all important parts of a balanced diet that helps lower the risk of heart disease and stroke.
"Our advice for people trying to improve their lifestyle is to focus on their whole diet, rather than the amount of individual foods or drinks they consume."