The Arduino board comes with a development environment through which the microcontroller present within the board can be programmed. The program is written in to the environment and then checked for errors and compiled. The Arduino is then connected to the laptop through a USB port and the program is burned into the microcontroller.
Once the program is burned the Arduino repeatedly executes the program as long as the USB or an external power source is connected to it.
A second part which compares the received input signals to the rule set and decides which switches to operate, and then sends the required output signals to activate the appropriate switches.