Try booting into recovery mode using Command + Option + R which may allow you to reinstall without authenticating with an AppleID (Apple's documentation on this is not clear, but worth a try).
Otherwise, if your iMac is unable to boot to the internal drive (or into Safe Mode), then you will need access to another Qualifying Mac in order to create a bootable macOS 10.11 USB installer as suggested by @Jack-19. A Qualifying Mac is generally one from 2008 to 2015. If you don't have access to another Qualifying Mac, then you will need to use the retail copy of the OS X 10.6 upgrade DVD.