As the last eMac was discontinued in 2006, I’ll assume you meant an iMac.
Here are the usual instructions:
Booting Recovery for the erase doesn’t need the passcode. If your iMac has run macOS 10.12 or later, Recovery is fairly capable. If the iMac is older, and if it’ll boot Recovery locally, Recovery can also erase local storage without the passcode. (Booting Recovery is described in the link, starting at step 6.)
You can sign out of your Apple Account and iCloud remotely, using account.apple.com (This is appropriate here, but don’t do this if the Mac is lost or stolen.)
You can also use Target Disk Mode to erase storage from another Mac. But you shouldn’t need to do that here.
If this is an eMac, then getting at it via Target disk Mode can require some now-rare gear. Do you have the DVD for that eMac?