The coexistence of type 2 diabetes mellitus (T2DM) and heart failure (HF), either with reduced (HFrEF) or preserved ejection fraction (HFpEF), is frequent (30–40% of patients) and associated with a higher risk of HF hospitalization, all-cause and cardiovascular (CV) mortality. The most important causes of HF in T2DM are coronary artery disease, arterial hypertension and a direct detrimental effect of T2DM on the myocardium. T2DM is often unrecognized in HF patients, and vice versa, which emphasizes the importance of an active search for both disorders in the clinical practice. There are no specific limitations to HF treatment in T2DM. Subanalyses of trials addressing HF treatment in the general population have shown that all HF therapies are similarly effective regardless of T2DM. Concerning T2DM treatment in HF patients, most guidelines currently recommend metformin as the first-line choice. Sulphonylureas and insulin have been the traditional second- and third-line therapies although their safety in HF is equivocal. Neither glucagon-like preptide-1 (GLP-1) receptor agonists, nor dipeptidyl peptidase-4 (DPP4) inhibitors reduce the risk for HF hospitalization. Indeed, a DPP4 inhibitor, saxagliptin, has been associated with a higher risk of HF hospitalization. Thiazolidinediones (pioglitazone and rosiglitazone) are contraindicated in patients with (or at risk of) HF. In recent trials, sodium–glucose co-transporter-2 (SGLT2) inhibitors, empagliflozin and canagliflozin, have both shown a significant reduction in HF hospitalization in patients with established CV disease or at risk of CV disease. Several ongoing trials should provide an insight into the effectiveness of SGLT2 inhibitors in patients with HFrEF and HFpEF in the absence of T2DM.