TFT LCD COUNTER FOR ARDUİNO DUE

Hi arduino due I have designed the counter on the tft screen but I want to make a button controlled counter but I can not find the necessary codes I use ILI9481 Mcu. I need help for button controlled.Thanks everyone

#include <UTFT.h>
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
UTFT myGLCD(ILI9481, 38, 39, 40, 41);
char printout[4];
int counter = 0;
const int but = 6;

void setup()
{
  randomSeed(analogRead(0));

  
  myGLCD.InitLCD();
  myGLCD.setFont(BigFont);
  pinMode(but, INPUT);
  myGLCD.setBackColor(0, 255, 255);
  myGLCD.setFont(SevenSegNumFont);
  myGLCD.print("saniye", CENTER , 120);
}
void loop() {
  counter = millis();
  String elapsedTime = String(counter / 1000);
  elapsedTime.toCharArray(printout, 4);

  myGLCD.clrScr();
  myGLCD.setColor(255, 255, 255);
  myGLCD.print(printout, CENTER, 120);
  delay(1000);
  myGLCD.setColor(0, 0, 0);
  myGLCD.print(printout, CENTER, 120);




}
  counter = millis();

The current time is NOT a counter.

  elapsedTime.toCharArray(printout, 4);

When counter exceeds 999000, after about 16 minutes of running, this function will NOT transfer all the characters in the String to the array.

but I want to make a button controlled counter

Is the button supposed to be drawn on the screen? How, EXACTLY, is it supposed to "control" the counter? What, EXACTLY, are you counting?

My LCD screen is not touchable, so I want to connect an external button.
Counter = millis ();
String elapsedTime = String (counter / 1000);
ElapsedTime.toCharArray (printout, 4);
When I count the number 0-999 through 999, I reset it again. I do not have any problems in the program.