The study evaluates the safety of different doses of a new medicine called NNC0519 0130. It also looks into how the medicine may improve kidney function in participants with chronic kidney disease with or without type 2 diabetes, living with overweight or obesity. The participants will either get NNC0519-0130 (a new medicine), semaglutide (a medicine that doctors can already prescribe), or placebo (a "dummy" substance). Which treatment the participant will get is decided by chance. The study will last for up to 43 weeks.