You Cannot Use the 24-inch iMac as a Target Display (aka External Monitor)
https://wccftech.com/you-cannot-use-the-24-inch-imac-as-a-target-display-aka-external-monitor/
If you were wondering whether or not you can use your 24-inch iMac’s 4.5K Retina display as an external monitor, well, you cannot.
Little do people know, Macs sold before 2014 had a built-in feature called Target Display Mode where you could use your iMac as an external monitor. The feature was great and Apple removed it entirely with 2014 iMacs and above.