@surfbug,
A warm welcome to Mac-Forums.
I am reading your post to mean:
1. The iMac is working fine.
2. Time Machine is not working.
IF, I'm correct with these two statements, then you can do several things.
A. With Time Machine attached via USB, as I assume it is, you can open Disk Utility (DU). This is found in Finder > Applications > Utilities > Disk Utility (DU)
Once DU is open, Click on the TM External Hard Drive (EHD) using the Indent rather than the name of the EHD. If you are running macOS High Sierra or higher, you will see something like this:
In my example, you would click on the indent with the red arrow - you will have different names for your EHD. Now use Disk Utility (DU) to First Aid. It will take time. Be patient. Either it will fix any issues or tell you that it cannot fix things. If fixed, fine. If not, then consider plan B.
B. With TM attached, and using DU as above, simply Erase the EHD and reformat it Mac OS X Extended (Journaled). Then start a new TM backup.
Personally, I'd go for plan B - always assuming, as I said at the start,
that your iMac is working normally.. I don't trust backups that fail and First Aid is okay if you absolutely must salvage that TM backup, but an Erase/Reformat will clear out everything and give you a clean start.
Ian