countdown with start/stop button

Anybody who can help me out?

the objective of this program is to simply use one button to start and stop the counter. First push enables the counter to start counting down and the next push enables the counter to stop. I've got my tried code down but im stuck to this. I don't know how to proceed.

int state=0;
int state1=0;
const int startStopButton=2;
int counter=24;
int previousMillis=0;
int duration=1000UL;
int previousButton=0;


void setup()
{
  Serial.begin(9600);
  pinMode(startStopButton,INPUT);
  

  }
  

void loop()

{
  int startStop=digitalRead(startStopButton);
  if(startStop==HIGH && previousButton==LOW)
  {
     unsigned long currentMillis=millis();
     if(currentMillis-previousMillis>duration)
        {
          counter--;
          Serial.println(counter);
          state1=(1+state)%2; 
           previousMillis=currentMillis;
         state1=(1+state)%2;
          
        } 
     
       
     
     previousButton=startStop;
     
  }

  if(startStop==HIGH)
  {
    state1=1;
    state1=(1+state1)%2;
    if(state1==0)
    {
     counter;  
     Serial.println(counter);
    }  
  }
  
  
  }

int previousMillis=0; Timing variables are: unsigned long

What does this do? state1 = (1 + state) % 2;
state1 = (1 + state) % 2;
previousMillis = currentMillis;
state1 = (1 + state) % 2;

How does previousButton ever get LOW?
previousButton = startStop;

How is your switch wired?

When will this ever be true?
if (currentMillis - previousMillis > duration)

What is this sketch for?

.