Using IR sensor to count and values saved in eeprom

Hi Guys! I am student at Viet Nam. Now i try to do my homework : "Count the number of people in a room using IR sensor values stored in eeprom " Request: 1) count the number of people in the room saved to eeprom and display 2) When you press the button, the value in eeprom = 0 and the count will start again

I've completed the code. But it doesn't have eeprom to save. Please help me! Thank you! This is my code:

int button = 24;
int irPin1 = 22; 
int count;
int laststate1 = HIGH;

void setup()
{
  
  Serial.begin(9600);
pinMode(button, INPUT_PULLUP);
pinMode(irPin1, INPUT);
delay(1000);
}
void loop()
{
  int buttonStatus = digitalRead(button); 
  if (buttonStatus == HIGH) { 
  int state1 = digitalRead(irPin1);
  if (laststate1 == LOW && state1 == HIGH) 
  {   
      count++;
     Serial.println(count);     
  }
  laststate1 = state1;  // remember last state

  } else { 
     count=0;
     Serial.println(count);
     delay(500);
  }   
}

But it doesn't have eeprom to save.

Why not? EEPROM.read() and EEPROM.write() methods are not hard to use.

But when i press button to write EEPROM = 0, it doesn't work. Please help me.

tranduyenit: But when i press button to write EEPROM = 0, it doesn't work. Please help me.

That's not written anywhere in the code you posted. Post that code if you want help with it. And please describe exactly what you mean by "doesn't work". What did it do?

I have solved it already.
Thanks everyone.
#include <EEPROM.h>
int button = 2;
int pirPin1 = 28;
int counter;
int laststate1 = HIGH;
int address =1 ;

void setup()
{

Serial.begin(9600);
pinMode(button, INPUT_PULLUP);
pinMode(pirPin1, INPUT);
delay(2000);
}
void loop()
{
int buttonStatus = digitalRead(button);
if (buttonStatus == HIGH) { // Nếu mà button bị nhấn
int state1 = digitalRead(pirPin1);
if ( laststate1 == LOW && state1 == HIGH)
{
counter++;
EEPROM.write(address, EEPROM.read(address)+1);
Serial.println(EEPROM.read(address));

}
laststate1 = state1;
} else {
counter =0;
EEPROM.write(address, 0);
Serial.println(EEPROM.read(address));
delay(500);
}

}