A solenoid coil comes off its stem without opening the valve or the system: isolate, pull the plug, remove the nut, slide the coil off, slide the new one on, match voltage and AC or DC. If the valve still does not shift with the new coil energized, the valve is stuck and the system has to be isolated to open it. A limit switch is replaced with the same contact arrangement, then adjusted so it operates a little before the mechanical end of travel, and tested by operating the machine slowly to the limit. A prox sensor is replaced with the same type (NPN or PNP, NO or NC, inductive or capacitive) and the same thread, set to the gap on its data sheet with the lock nuts, and proved by its own LED and the PLC input LED together.
Pocket rules. Coil: voltage and AC/DC. Limit: operate before the stop, test slowly. Prox: same type, set the gap, two LEDs.