Without the original system (install disc or if newer, internet recovery to reformat replacement HDD)
even troubleshooting the computer can be difficult. With an iFixit guide for repairing iMacs, you may
be able further troubleshoot. The bootable USB would need to be a supported OS X for the iMac,
and not one tied to another AppleID if the computer has been setup with newer OS X from online.
The original OS X version for that model number (more known if you better identify the iMac) appears
to be OS X 10.6.1. The model number covers three different Machine Numbers, or build identifiers.
iMac10.1, iMac11.2, iMac12.1; from the year 2009 to present. They are not all alike. If you can see
what the computer really is, though serial number, that can help get parts & suitable OS X.
There were at least Seven different sales model numbers of the A1311 iMac, over a few years.
If the computer does not have an original install-boot DVD, you may be able to order a replacement
for a fee (if you can identify the computer; later models that shipped with OS X 10.7 or later, or do
not have an optical drive, may not be able to use retail 10.6.3 Snow Leopard DVD $20 from Apple)
Some fringe models may have shipped with special USB flash drive with Lion 10.7 from Apple.
With the serial number, one could call Apple Sales Support and ask about the availability of system
DVD replacement; the unit may be too new or too old. There would be a fee for that, if they locate it.
You could also use an online lookup by serial number to better identify the computer, such as one
from powerbookmedic https://www.powerbookmedic.com/identify-mac-serial.php
When the hard disk drive is suspect, you really do need to prepare replacement HDD from a working
OS X so it can use the installer. A bad hard drive also means the computer can't go online. A USB
flash or hard drive copy of an installer, may not be correct for the computer (model build.)
Between an iFixit guide, a replacement correct-spec hard drive (with Temperature Sensor) & the
correct OS X system to start over again properly, these may not be too costly. Note the HDD...
the lack of a sensor will force the fans to run at full speed. So correct replacement part is very helpful.
Good luck in this matter! 🙂