void setup()
{
    pinMode(4, OUTPUT); pinMode(8, INPUT_PULLUP);
}
void loop()
{
if(digitalRead(8)){
  digitalWrite(4,1);
}else{
    digitalWrite(4,0);
}

}