Hello sir, I bought used iMac and I want to install macOS, there is ubuntu inside, I've downloaded this torrent, how can I install this on iMac? Can you help me, please?Yes, you must install VirtualBox on your PC, then install this disk-image.
I don't believe posting links is allowed, so I'll explain how to search for the tutorial on how to do this.
For a tutorial on installing this image on a PC, Google the following (the first result will teach you everything you need, step-by-step)
If you run into any problems, let me know, I've installed this a few times without issues.