what is the difference between the switch and relay?
They both serve the same function, i.e., opening or closing a set of contacts to control an electrical device. Switches are manually actuated by the user. Relays are controlled by energizing an electro magnet, which in turn causes the contacts to open/close.