There is a lot of bad information related to Target Display Mode, and at no fault to anyone on Mac Rumors, but because Apple's support page on it contains information that is incorrect.
I am pondering buying a Mini M2 and using the 27” as a monitor off the M2. Is this possible?
Yes, this will work fine, as long as your iMac still boots.
What would I have to do to the current 27” to make this possible? Thanks!
The iMac needs to work and boot up. I recommend using an external SSD or even a cheap flash drive as a boot drive, just to get it working and booting.
Then, all you need is a USBC to Mini Display Port cable, then plug the Mini Display Port side into the back of the iMac, and then the USBC side into the M2 Mac Mini, and it should connect automatically.
If it doesn't then you need to press "Command" and "F2" at the same time on the keyboard connected to the iMac, and it should display the Mac Mini. This also takes you back to the iMac if you need to.
Note: I have experienced the above keyboard press not work on keyboards that did not come with the iMac. I was using an Apple keyboard, just a different model and not the one that came with the iMac (I didn't like the one that came with it), and the button presses didn't work. I then used the one that came with the iMac and it worked.