Welcome!
Apple won't give you anything on trade-in for it, but will take it for recycling. Info on recycling is in thie Apple Traade-in document in the FAQs:
Apple Trade In - Apple
If you have files on the hard drive that need to be recovered and do not have a backup. that could be a problem. Your symptoms could very well suggest a failing hard drive. If you cannot access the files using another Mac in Target DISK Mode:
Transfer files between two Mac computers using target disk mode - Apple Support
...you may have to physically remove the drive from the iMac and attach it to a working Mac using a USB bare drive adapter. Even then, a dead/dying may not be recoverable.
I doubt you'll get any suggestions for repurposing here, but a web search for "mac mods" will turn up a number of sites where people show how they have repurposed their old Macs.