Bluetooth and wifi stopped working
Unfortunately, the AirPort adapter in your iMac has failed.

Your issue is is just like the issue in the question Mac Mini frequently loses connections (both Wi-Fi and Bluetooth) where the only difference is in that question, The problem was intermittent and yours appears to be permanent.

The AirPort adapter is just the mPCIe card that has a “combo” Bluetooth and WiFi chip (usually made by Broadcom).  Dell, HP, Asus and pretty much every manufacturer uses some variant of this chip/adapter.  That means this adapter is not very expensive.

However, since the iMac computers from 2012 on have the screen glued in place, the labor could be costly to change the part.  If this is the case, upgrade your hard disk to an SSD while it’s open.