Step 1To iMac as external monitor for PC, you need to connect them together with a Thunderbolt cable. The Retina 5K iMac can't be used as Target Display Mode display. The 27-inch iMac with Mini DisplayPort, iMac with Thunderbolt port, PC with a Mini DisplayPort and a supported video cable, and PC with HDMI port and a HDMI to Mini DisplayPort converter can make the connection and use iMac as monitor for PC.
When you want to use iMac as monitor for PC, you should make sure both your iMac and Windows PC have some hardware support.