This study will look at how well CagriSema helps people with type 2 diabetes lower their blood sugar and body weight. CagriSema is a new investigational medicine. Doctors may not yet prescribe CagriSema. CagriSema will be compared to a medicine called tirzepatide that doctors may prescribe in some countries. Participants will get either CagriSema or tirzepatide. Which treatment participant get is decided by chance like flipping a coin. Participant will have an equal chance of receiving either drug. For each participant, the study will last for up to one and a half years.