Need help making mac osx installer

I have this imac that my brother bought 2nd hand. It was running mac osx el capitan on it and was working well until he accidentally wiped the hard drive clean when cleaning up the system.

Since then we got linux runing on it but I want to have el capitan on it again to have it working like before. (Personally I think that it struggles running modern linus on 3gb of ram)

  1. How would I go about making an installer for it? I normally dont work with mac stuff and dont know the work arounds to make an bootable usb for installing osx.

  2. I downloaded the official installer from apple. How would I make a bootable usb or iso file that I use with rufus/balena etcher?

  3. I did look around and found on the internet archive some people have uploaded iso files of the mac osx el capitan. Are they safe to use? Or atleast use as a jumping off point to install macosx and create a bootable usb from the dmg that apple has on their website?

Thank you for any help possible.

Author: @squidoeye23