That model would have shipped from the factory with a macOS Restoration CD/DVD.
If you don't have those discs and all you want to do is securely erase the internal drive, then try creating & using a bootable ShredOS USB stick in order to write zeroes to the whole internal hard drive. You should be able to use the 64bit version:
https://github.com/PartialVolume/shredos.x86_64
If you want to try to recover data from the internal hard drive, then you could try creating & using a bootable Knoppix Linux USB stick. Knoppix has the drivers necessary to access the HFS+ file system, but you will need to connect another external USB drive for saving the recovered items.
You can also try booting the iMac into Recovery Mode using Command + R (perhaps even better is Command + Option + R so that you are not prompted to authenticate with an AppleID which you won't have that will work). If you can boot into Recovery Mode, then try installing macOS to an external drive (you will need to properly erase or even partition & format the external drive using Disk Utility). Then you can boot the iMac from the external drive to see if any personal information remains. Or if you are familiar with the command line, you can check while booted into Recovery Mode.
If you can boot into Recovery Mode, then you can also use Disk Utility to securely erase the internal hard drive. Disk Utility does have an option to secure erase a hard drive by writing zeroes or even random data to the drive (usually a single pass of zeroes is sufficient). This assumes the hard drive is still healthy enough to complete the task.
This all assumes that the internal hard drive is still healthy. More than likely the internal hard drive is worn out or even failing.