Turn on a light when there is an input
Use input with pullup on pin 8 and a button to ground (GND). See below:

const int ledPin = 4;
const int buttonPin = 8;

void setup() 
{
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
}

void loop() 
{
   digitalWrite(ledPin, digitalRead(buttonPin));
}


Using the pin as input and disconnecting is not the same as GND. The pin is floating. By using the internal pullup resistor the pin is HIGH when the button is not connected to GND.