This study tests how well different doses of the medicine NNC0662-0419 help people living with overweight or obesity. The purpose of the study is to find out if NNC0662-0419 is safe and effective for treating people living with overweight or obesity. There are 2 study treatments in this study, participants will get either NNC0662-0419, the treatment being tested or placebo, a treatment that has no active medicine in it. NNC0662-0419 is a new medicine which cannot be pre-scribed by doctors but has previously been tested in humans.