A contactor is an electrically controlled switch used for switching an electrical power circuit for example to provide power to a motor or remove power from a motor. A contactor is typically controlled by a circuit that has a much lower power level than the switched circuit, such as a 24-volt coil electromagnet controlling a 230-volt motor switch.
There is a variety of contractors in the market, we shall describe the functionalities of contactors based on Siemens Sirius type contactors. The following diagram shows how we can make connection/disconnection of supply electricity when we apply control voltage (24V DC) to A1 and A2 then line 1<>2 and 3<>4 get connected, on the other hand, R1<>R2 and R3<>R4 are disconnected.
The control voltage can be applied by the PLC program or by any other programming circuit that can provide a 24V supply. If we want to control the motor (forward and reverse direction) easily we can build it as shown in the following video.