ARduino UNO keeps reseting

Hey guys, so im doing this alarm clock project and its not finnished. But i tried and uploaded it unfinished. there were no errors. My project includes buttons but i tried only button first. Supposed to be, the button named numsel (in my sketch) adds a number to an array but when i press it the arduino keeps resetting so i cant get the output from the serial monitor . This is my code:

/*
Alarm Clock 
BUTTONS
SERIAL MONITOR
*/
const int numsel = 7;
const int unsel = 3;
const int snooze = 4;
const int dismiss = 5;
const int set = 6;
const int buzzer = 12;

int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int buttonState4 = 0;
int buttonState5 = 0;
int buzzerState = 0;

byte inputTime[4] = {0, 0, 0, 0};
byte inputAlarm[4] = {0, 0, 0, 0};
void setup() {
  pinMode(buzzer ,OUTPUT);
  
  pinMode(unsel ,INPUT);
  pinMode(numsel ,INPUT);
  pinMode(snooze ,INPUT);
  pinMode(dismiss ,INPUT);
  pinMode(set ,INPUT);
  
  Serial.begin(9600);
}

void loop() {
  buttonState1 = digitalRead(numsel);
  buttonState2 = digitalRead(unsel);
  buttonState3 = digitalRead(snooze);
  buttonState4 = digitalRead(dismiss);
  buttonState5 = digitalRead(set);
  buzzerState = digitalRead(buzzer);
  sertime();
}

void sertime() {
  Serial.print("Please Enter the time into the serial monitor using the buttons:");
  Serial.print('\n');
  delay(10000);
  Serial.print(inputTime[4]);
  Serial.end();
  if (buttonState1 == HIGH) {
    if (buttonState1 == LOW) {
      Serial.begin(9600);
      inputTime[3] = {1};
      Serial.print(inputTime[4]);
    }
  }
}

Please help me out.
Thanks in advance

Serial.print(inputTime[4])

Oops

  if (buttonState1 == HIGH) {
    if (buttonState1 == LOW) {

It can’t be both now, can it?

How is your button wired?