How to make a button in this code

I’m trying to implement a button in this but I don’t know how D: please help!

Codes:
int referenceVoltage = 5; // use the default voltage as a reference
int initialReading; // raw value pulled of analog pin
float initialVoltage; // real voltage converted from reading
int analogValue; // store the analog reading here
int analogPin = 0; //use A0 as the analog pin
int shortPin = 3; // use pin D0 to turn on the transistor which will short the battery
int startButton = 4; // Use D4 pin to register when a button is pushed.
const int numberOfMeasurements = 20; // take 20 readings each time
int Stored[numberOfMeasurements];
int numReadings = 200; //Change this when you know how many readings you want!!!
float volt;
int refvolt = 5;
int msec = 0;

void setup() {
delay(50);
initialReading = analogRead(analogPin); // get the battery’s initial voltage
initialVoltage = initialReading * referenceVoltage / 1024;
Serial.begin(9600);
if (analogPin); {
Serial.print(analogPin);
msec = millis();
}
}

void loop() {
for (int i = 0; i < numReadings; i++) {
volt = volt + analogRead(analogPin);
}
digitalWrite(shortPin, HIGH);
delay(500);
volt = volt / numReadings / 1024 * refvolt;
Serial.print(volt);
Serial.println(‘Battery Recovery Profile’);
volt = 0;
delay(10); {
Serial.print(millis() - msec);
Serial.print(" ");
}
}

Woops, sorry, I posted this in the wrong forum