You are welcome. Your Mac is too old for Internet Recovery. A bootable USB would allow a reinstall, but since you have never downloaded Yosemite using your Apple ID, it isn't available to you.
If it is a late 2009 iMac, that computer can be upgraded to High Sierra. To make a bootable installer, you need access to another Mac where you can sign into the App Store to download the installer. I'll post links to El Capitan, Sierra, and High Sierra. The computer you download the installer on will affect which OS you can download.
How to get macOS High Sierra
Sierra download
El Capitan
You can make a bootable USB stick to install using this free program which will do all the work for you.
Bootable USB Flash Drive – Diskmaker X oruse Apple’s method Create a bootable installer for OS