how to connect iMac to Macbook as second screen / external display
I have a personal iMac (late 2012 model I believe) that is running on Catalina (v 10.15.7), and I have a work macBook pro that is running on Sonoma (v 14.3) . I would like to be able to use my iMac as a second screen to my work laptop as I work from home quite a lot (it is silly to be looking at that small laptop screen all day, when I have this huge iMac screen right next to it).
I can't figure out how to connect these. The articles on apple don't help, as they say "the iMac must have macOS High Sierra or earlier installed" - which I don't, Catalina came later than Sierra.
I tried connecting them with cable. the iMac does not have an HDMI input, so all I could do is plug in the USB-C (charger) cable into my macBook on one end, connect that to a transformer that transformed it into a USB-A outlet, and I plugged that into the iMac. Nothing happened.
Does anyone have any ides?
iMac 27″, macOS 10.15