Inclusion Criteria:  Male or female, age above or equal to 18 years at the time of signing informed consent. Body mass index (BMI) greater than or equal to 30.0 kg/m^2 New York Heart Association (NYHA) Class II-IV Left ventricular ejection fraction (LVEF) greater than or equal to 45% at screening Diagnosed with T2D greater than or equal to 90 days prior to the day of screening HbA1c of below or equal to 10.0% as measured at the screening visit  Exclusion Criteria:  A self-reported change in body weight greater than 5 kg (11 lbs) within 90 days before screening irrespective of medical records Uncontrolled and potentially unstable diabetic retinopathy or maculopathy. Verified by a fundus examination performed within 90 days prior to screening or in the period between screening and randomisation. Pharmacological pupil-dilation is a requirement unless using a digital fundus photography camera specified for non-dilated examination.