Using timer0 on Arduino Uno
The main problem is you are using the wrong interrupt handler. You are setting up Timer1, but the interrupt handler is for Timer0:

boolean toggle0 = 0;

void setup() {
pinMode(8, OUTPUT);
  cli();
//set timer1 interrupt at 1Hz
  TCCR1A = 0;// set entire TCCR1A register to 0
  TCCR1B = 0;// same for TCCR1B
  TCNT1  = 0;//initialize counter value to 0
  // set compare match register for 1hz increments
  OCR1A = 15624;// = (16*10^6) / (1*1024) - 1 (must be &lt;65536)
  // turn on CTC mode
  TCCR1B |= (1 &lt;&lt; WGM12);
  // Set CS12 and CS10 bits for 1024 prescaler
  TCCR1B |= (1 &lt;&lt; CS12) | (1 &lt;&lt; CS10);
  // enable timer compare interrupt
  TIMSK1 |= (1 &lt;&lt; OCIE1A);

  sei();
}

ISR(TIMER1_COMPA_vect){  //change the 0 to 1 for timer1 and 2 for timer2
  toggle0 = !toggle0;
  digitalWrite(8, toggle0);
}

void loop() {

}