Arduino code run only once with press of a button

I have been making this code to run 3 motors one after another for cocktail machine. i want to run the code only once with press of a button. i am unable to put the code for the button. please help me. below is the code.

#define in1 7
#define in2 8
#define in3 9
#define in4 10
#define in5 11
#define in6 12

void setup()
{

pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
pinMode(in5, OUTPUT);
pinMode(in6, OUTPUT);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
digitalWrite(in5, LOW);
digitalWrite(in6, LOW);
}

void loop() {

digitalWrite(in1, HIGH); // motor 1 starts in one direction
delay(5000);
digitalWrite(in1, LOW);
delay(500);

digitalWrite(in3, HIGH); // motor 2 starts in one direction
delay(5000);
digitalWrite(in3, LOW);
delay(500);

digitalWrite(in5, HIGH); // motor 3 starts in one direction
delay(5000);
digitalWrite(in5, LOW);
delay(500);

}

Move the code currently in loop() to its own function. Let's name it dispenseDrink().
Read the button input at the start of loop() and when it becomes pressed (see StateChangeDetection example in the IDE) call the dispenseDrink(). function.

Personally I would give the output pins better names as in1, in2, in3 etc sound like inputs.