That 2007 imac has firewire. Do you have another mac with FW? If so you can connect the two with a fw400 or fw800 cable. This will make the 2007 imac look like an external hard drive on your other mac and from there you can inspect and attempt to repair or clone the imac hdd via Disk Utility.
1. what are the parameters i need to consider before purchasing SSD
The spinning hard drive in the mac is a standard 3,5" size with SATA connectors. That drive is probably SATA1 and what you'll find today in 2025 is SATA3. Good news is that the standard is reverse compatible so a SATA3 drive should clock down and work fine with SATA1 controller. The SSD you will replace it with is 2.5" with the same SATA connectors. The mac has a 3.5" mount that clips the drive to the computer but the newer SSD will be too small. You can buy a 2.5 to 3.5 adapter for a few bucks like
this one or you could do like I did which was to use some sticky backed velcro and stick the SSD to the case of your imac LOL. Either works fine but if I did it again for the 8-10 bucks they cost, I'd use an adapter I think so I could leverage the clip/mount. Ifixit is a great resource for visual instruction on how to get into and replace your drive which you can see
Here.
2. how should i install a new apple os, via dvd(in case of staying with the old drive) or to put an image file directly onto the SSD?
I think most folks nowadays use a big usb Flash drive to do this.
Here is Apples instructions on how to make a bootable OS installer back to El Capitan (The OS that was on your imac). There are also videos on YT that discuss this process, so lots of resources in different formats for different learners out there. I know for Windows 10/11 the minim rec is 8gb in size and for most of my early Intel Macs, I use a 16gb flash drive. IIRC Apple recommends at least 32gb for modern Macos nowadays but for El Cap, 16gb should be fine I think. Still, SS memory is so cheap today, if you dont have a big flash drive, I just
bought a 128gb flash drive with both USB A & C for $12 - very handy for tasks just like this and for jumping between my EI & PPC macs and AS M2 mbp that is USB-C only.
3. are there detailed guides on how to create bootable single layer dvd/ saving image onto the new ssd?
If I understand what you're asking correctly, once you get El Cap installed, you can run Time machine and create a back up that way, or you could use an app like
Carbon Cloner Copy 5 (v5.1.28 to be exact) to create a bootable clone of your installation onto an external drive, NAS etc. so if you have problems in the future, you can simply restore with one of those backups. Heck, solid state memory is so darn cheap right now (just picked up two 120gb ssds for $10 each on Amazon) you could pick an extra up, drop it into an external enclosure and clone your El Cap boot drive image to it so if your boot drive SSD fails, you have a ready to go replacement that you could drop into your imac or that you could boot from via the USB2 or FW400 or 800 external enclosure. Lots of ways to slice that pickle
Good luck.