If you want to install Linux to the iMac, then I recommend using Linux Mint as it is easy to install and just works with Macs (according to a co-worker). There are things I don't like about how Linux Mint does things, but it is a good option for someone new and learning Linux and I do like how the Linux Mint team is trying to fix things Ubuntu has been changing. Ubuntu is another option, but the default Ubuntu tends to require a more powerful system with more resources so it is better to use one of the Ubuntu flavors such as Kubuntu and Ubuntu MATE. Linux Mint is made from Ubuntu and Ubuntu is made from Debian so a lot of what you learn can be used with the other distributions (you just need to know the slight differences if you move between them).
You can create a bootable Linux USB installer by using the downloaded Linux installer .iso file as a source for Etcher (Mac/Windows/Linux). Then Option Boot the iMac and select the orange icon labeled "EFI".
Linux is a great way to extend the useful life of older computers especially when you are restricted to only running macOS 10.11 which is very outdated today.