First, if you post please use the # button to tag code correctly
Give this a try, I removed a { and added an extra delay(200) , .. (code not tested)
const int buttonPin = 2;
const int hl = 3;
int buttonState = 0;
void setup()
{
pinMode(hl, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH)
{
digitalWrite(hl, LOW);
}
else
{
digitalWrite(hl, HIGH);
}
delay(200); // extra
digitalWrite(hl, HIGH);
delay(1000);
digitalWrite(hl, LOW);
delay(1000);
}