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."