Arduino code to control 4 led's from 4 buttons
It is likely you have connected the switches incorrectly.  Normally, people use single poll single throw (SPST) switches connected to 5 volts and the input pin of the Arduino.  This will pull the input pin to 5 volts when the switch is closed.  Then, to pull the input pin to ground when the switch is open, people add a large resistor between ground and the same processor pin.



Almost any large resistor will work here.  Consider using 10K ohms (10,000 ohms) or there abouts.

Of course, if you are using a 3 volt Arduino, do not connect the switch to a 5 volt source.  Instead connect it to a 3 volt source.

Alternatively, a pull up resistor inside the processor, if available, can be activated.  Look at this arduino.cc web page. There this sample code shows how to activate the processor's pull up on pin number 2:

pinMode(2,INPUT_PULLUP); 


Because not all processors have a "pull up" feature on all input pins &amp; because the range of internal to the processor pull up resistances can vary (for example 50,000 ohms to 150,000 ohms), it may be more useful and universal to use an external pull up resistor.