That model is a 2011 model which is 11 years old.
It sounds like some component on the motherboard has failed, the CPU, GPU, etc. iMac components are not interchangeable between models.
To see if the screen and boot drive are still good try booting ints Target Disk Mode. If those two components are good you should get this screen:

If you have a working Mac to connect to the iMac even if the screen is bad and the drive is good you should be able to access the iMac's boot drive with another Mac properly connected per the article above.
If you decide to look for a new Mac consider the following: If you're considering a new iMac and budget is a concern consider the following: a 10 Core Mac Mini M4 with 16 GB RAM and 1 TB SSD ($999 US) with a 32" LG 4k monitor ($250 US) from Amazon.com) is $1249 US which is $650 less than a similarly configured new 24" iMac ($1899 US). Keep your keyboard and mouse from your current Mac for use with the Mini.
I got the above Mini with a 32" LG 4K monitor w/speakers for the same price as a 27" monitor (didn't know the Mini had a speaker). There are many monitors available in 27" size for about $100 US to $500 US depending on what features you want. The prices are before tax, tariffs and the Strait of Hormuz.
I had an 2017 i7 iMac with an SSD boot drive and the new Mini runs circles around it. So much faster.
You can use the keyboard and mouse from your current iMac.
