RecruitingPhase 2Drug trialA Research Study Comparing How Well Different Doses of the Medicine NNC0662-0419 Lower Blood Sugar in People With Type 2 DiabetesThis study is being done to look at the effect and safety of different doses of NNC0662-0419 in people living with type 2 diabetes when compared to placebo or semaglutide. The purpose of this clinical study is to find out if NNC0662-0419 is effective and safe for treating people living with type 2 diabetes. Participants will get either NNC0662-0419, semaglutide or placebo. Which treatment participants get is decided by chance. NNC0662-0419 is a new medicine which cannot be prescribed by doctors but has previously been tested in humans. Semaglutide is an approved medication to treat type 2 diabetes.