How to use random function? Please Help

This is one of those rare times when the error is quite literal, the variable last_buttonState is not delcared.

First, you need to declare last_buttonState just like you did buttonState.

Then you need to read on if...else statements and comparison operators, including not equal to

You have some comments, but should have more. I will add some for you.

if (last_buttonState != buttonState) // is this button state not equal to the last button state
{
 last_buttonState = buttonState; // record current button state as last
 
 if (buttonState == HIGH) // is current button state HIGH
 {
   lcd.clear();
   lcd.print("Press button to get a random phrase.");
 }
 else if (buttonState == LOW) // is current button state low
 {

   byte index = random(0, 4);  //get a number between 0 and 4 :D
   lcd.setCursor(0, 0);
   lcd.clear();
   lcd.print(phrases[index]); //use it as the index to the array of phrases
 }

}

As I mentioned, you need to stop clearing the lcd if you want to stop the flickering. The information on the display only need to be updated when the button get pressed. Before you determine the state of the button, you need to determine if the state has changed (this is what I added).