Programming button question

I haven't figured out how to do this.
I wish to create a list such as:
Pit1
Pit2
Pit3 etc
Then using a momentary button to read the list and then place one item from the list in a desired location in the program to be executed. In other words I want to understand how to modify my program at the push of a button.
Can anyone offer some guidance?

Keep a counter that counts how many times the button is pressed and released (see the State Change Detection example that comes with the IDE for an example).

Based an the value of the counter, call a function

void loop()
{
  // read button and increment counter
  ...
  ...

  switch(counter)
  {
    case 1: 
      pit1();
      break;
    case 2: 
      pit2();
      break;
    case 3: 
      pit3();
      break;
  }
}

void pit1()
{
  ...
  ...
}

void pit3()
{
  ...
  ...
}

void pit3()
{
  ...
  ...
}

You need to fill in the dots. Also note that you will have to limit the counter value to the number of functions (pit1 .. pitN).

If you really have a lot of pit, your switch/case will grow out of hand and you might have to look into an array of function pointers.

I want to understand how to modify my program at the push of a button.

You cannot modify your program as you suggest but you can make it do different things depending on how many times a button has been pressed. If you need to do similar things depending on the number of button presses then it may be appropriate to write a function to take the action(s) and pass it different parameters to operate on.