how do i reinstall the OS on an iMac that was given to me

I was given this iMac because the original owner purchased a new one. He said he wiped everything & then tried to reinstall the OS from the disk that came with the iMac. then he couldn't eject the disk. I got the disk out but when i reinsert it says that the OS can't be reinstalled from this disk.
What can I do to get this iMac up & running
Welcome to iMore! What kind of Mac is it?

This might help: https://support.apple.com/en-us/HT204904

Original thread: https://forums.imore.com/threads/how-do-i-reinstall-the-os-on-an-imac-that-was-given-to-me.384755/