The observation that heart failure with reduced ejection fraction is associated with elevated circulating levels of pro-inflammatory cytokines opened a new area of research that has revealed a potentially important role for the immune system in the pathogenesis of heart failure. However, until the publication in 2019 of the CANTOS trial findings on heart failure outcomes, all attempts to target inflammation in the heart failure setting in phase III clinical trials resulted in neutral effects or worsening of clinical outcomes. This lack of positive results in turn prompted questions on whether inflammation is a cause or consequence of heart failure. This Review summarizes the latest developments in our understanding of the role of the innate and adaptive immune systems in the pathogenesis of heart failure, and highlights the results of phase III clinical trials of therapies targeting inflammatory processes in the heart failure setting, such as anti-inflammatory and immunomodulatory strategies. The most recent of these studies, the CANTOS trial, raises the exciting possibility that, in the foreseeable future, we might be able to identify those patients with heart failure who have a cardio-inflammatory phenotype and will thus benefit from therapies targeting inflammation.