Semaglutide is a medicine studied in patients with NASH. Semaglutide is a well-known medicine, which is already used by doctors to treat type 2 diabetes in many countries. Participants will either get semaglutide or a dummy medicine - which treatment participants get is decided by chance. Participants will need to inject themselves with medicine under the skin. Participants will need to do this once a week. The study will last for about 5 years. Participants will have up to 21 clinic visits and 9 phone calls with the clinical staff during the study. Some of the clinic visits may be spread over more than one day. Participants with other chronic liver diseases cannot take part in this study. Women cannot take part in the study if they are pregnant, breast-feeding or plan to become pregnant during the study period.