Inclusion Criteria:
- Age greater than or equal to 18 years at the time of signing informed consent.
- Body mass index (BMI) of greater than or equal to 24 and less than 28 kilogram per square meter ( kg/m^2) with the presence of at least one weight related complication (treated or untreated): Type 2 diabetes (T2D), hypertension, dyslipidaemia, obstructive sleep apnoea or cardiovascular disease or BMI greater than or equal to 28 and less 30 kg/m^2, with or without weight related complications at screening.
- History of at least one self-reported unsuccessful dietary effort to lose body weight.
For participants with T2D at screening:
- Diagnosed with T2D greater than or equal to 180 days prior to the day of screening
Treated with either:
- Diet and exercise alone or with 1-3 marketed oral antidiabetic drugs (metformin, alpha glucosidase, Sulfonylureas (SU), glinides, sodium-glucose co-transporter 2 inhibitors (SGLT2i) or glitazone as a single agent or in combination) according to local label.
- Treatment with oral anti-diabetic drugs should be stable (same drug(s) or active ingredient, dose, and dosing frequency) for at least 60 days before screening
- Glycated haemoglobin (HbA1c) of less than or equal to 10.0 percent (less than or equal to 86 millimoles per mol [mmol/mol]) as measured by the central laboratory at screening.
Exclusion Criteria:
- A self-reported change in body weight greater than 5 kilograms (kg) within 90 days before screening irrespective of medical records.
- Treatment with any medication for the indication of obesity within the past 90 days before screening.
- Personal or first-degree relative(s) history of multiple endocrine neoplasia type 2 or medullary thyroid carcinoma.
For participants without T2D at screening:
- HbA1c greater than or equal to 6.5percent (48 mmol/mol) as measured by the laboratory.
For participants with T2D at screening:
- Renal impairment with estimated Glomerular Filtration Rate (eGFR) value of less than 30 milliliter per minute per 1.73 square meter (mL/min/1.73 m^2) according to Chronic Kidney Disease Epidemiology Collaboration (CKD-EPI) creatinine equation as defined by Kidney Disease Improving Global Outcomes (KDIGO) 2012 classification by the central laboratory at screening.
- Uncontrolled and potentially unstable diabetic retinopathy or maculopathy. Verified by a fundus examination performed within the past 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.