8T external HDD failing to format
There's a few reasons why this can happen, but to start with I would try two very simple things: (1) plugging the drive into a different port, and (2) trying a different cable.

If that doesn't work I would try using Disk Utility from macOS Recovery.

You don't specify the version of macOS you're running, but you should be able to use these steps to use Disk Utility from macOS Recovery


Fully shutdown your iMac
Power up your iMac and immediately press and hold the Command ⌘ + R keys
Let go of the keys once you see the Apple logo
Eventually you'll see the macOS Utilities window 
Now select the Disk Utility option
When Disk Utility opens, use it as you normally would to try and format the external drive


If you still have no joy, post a comment below to let me know what happens.