Keeping the beneficial bacteria that live in our gastrointestinal tract (GI) happy and healthy is becoming more and more important for your own good health, a number of studies from the last decade have found.

For one thing: By measuring levels of a certain molecule produced by bacteria in the gut—think of it like a red flag for heart health—scientists can determine how healthy your heart is, according to a new study just published in the European Heart Journal.

The molecule, called trimethylamine N-oxide (TMAO), is produced by gut bacteria when you eat red meat, eggs, and dairy. When there’s more TMAO in your bloodstream, doctors have found, your risk of heart problems increases. When people admitted to the hospital with chest pains were tested for TMAO, the worst 25% were nearly six times more likely to kick the bucket, suffer a stroke or heart attack, or require coronary bypass surgery up to six months later—and they were almost twice as likely to die within seven years.

The good news? Getting your gut to help your heart may be as simple as limiting red meat and dairy and focusing on the Mediterranean Diet, which is heavy on plant foods like fruits, veggies, nuts, and whole grains; replaces butter with olive oil and canola; favors fish and poultry over red meat, and (hell yes!) allows a daily glass of red wine. Pair it with plenty of exercise and pro- and prebiotics—likeyogurt, kimchi, and asparagus—and your “gut bugs” will help make you (and your heart) happy and healthy.