Need Help with Button, a.s.a.p

Haaii noob here, i have a code that i recently made.. here is the code:

(Code tags please! Thanks, Moderator)

const int ledPin =  13;
boolean c = true;
boolean g = true;
int i;
int k;
int skor = 0;
long rnum;
unsigned long timeStart = 0;

int buttonState = 0;
int buttonState1 = 0;
void setup() {
  Serial.begin(9600);
  // put your setup code here, to run once:
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  

}

void loop() {
  // put your main code here, to run repeatedly:
buttonState = digitalRead(8);
buttonState1 = digitalRead(9);

/*if(buttonState == HIGH) {
  digitalWrite(2,HIGH);
  if(buttonState1 == HIGH) {
    digitalWrite(3,HIGH);
  }
    else{
      digitalWrite(2,LOW);
      digitalWrite(3,LOW);
    }
}
  */

  while(c){  
  //--------------------LED INDIKATOR NYALA--------------
  while(g){
  rnum = random(2,6);
  digitalWrite(rnum,HIGH);
  Serial.println("\nRANDOM\n");
  g=false;
  break;
  }
  Serial.println("\nDIABC\n");
  //-----------------------------------------------------
    /*timeStart=millis();
    if(digitalRead(9) == LOW){
    if (millis()-timeStart>=5000) {
    digitalWrite(2, HIGH);
    delay(100);
    digitalWrite(2, LOW);
    digitalWrite(3, HIGH);
    delay(100);
    digitalWrite(3, LOW);
    digitalWrite(4, HIGH);
    delay(100);
    digitalWrite(4, LOW);
    digitalWrite(5, HIGH);
    delay(100);
    digitalWrite(5, LOW);
    digitalWrite(rnum, LOW);
    c=false;
    break;
    g=true;
    
  }
  }
  if(g){
    Serial.print("\nNEXT\n");
    c=false;
    g=false;
    break;
    */
 // }
  }
 // if(digitalRead(8) == HIGH && digitalRead(9) == HIGH) c=true; g=true;
  
}

i want to ask, why my button cannot detect any input ?

Try this change: pinMode(8, INPUT_PULLUP); pinMode(9, INPUT_PULLUP);

and wire button to connect the pin to Gnd when pressed. Then:

if (digitalRead(8)== LOW){ 
// button was pressed when the pin was read
}

c is only made true at the start. Nowhere else.

Here you have a while loop that switches itself off and breaks inside itself. Why? Tired of if()?

  while(g){
  rnum = random(2,6);
  digitalWrite(rnum,HIGH);
  Serial.println("\nRANDOM\n");
  g=false;
  break;
  }

Also why use int when byte will do? You don't have much RAM to make a practice of wasting it.

How are your buttons debounced?