One Digital Button used for multiple scenarios

Been trying to code this section for a while but seem to be ending up with a lot of variables and just seems like mass confusion.
Is there a way to have a digital button be used to say kick a relay if the LCD is on page 1 but then if the LCD is on page 2 that same button kicks another relay. Ill post my code if needed but it a jumble of mess the way I am attempting to do it.

On page 1 on LCD it will list 4 areas you can go to. Hardwired buttons are next to each category. On page 1 if you hit a button then i need to make that button go to that page. On that page then there is my relays. Listed right beside each button. So then i Hit that same button that brought us to this page will kick that relay.

Is there a way to have a digital button be used to say kick a relay if the lcd is on page 1 but then if the lcd is on page 2 that same button kicks another relay.

Your terminology leaves a lot to be desired, and might explain why you are having problems writing the code. The Arduino can't "kick a relay". It can set a pin HIGH or LOW. There might be a relay attached to that pin that is triggered by the pin state change.

The LCD can't be "on page 1" or "on page 2". The LCD can display some text. You might have the idea that the text being displayed at some point in time has meaning as "page 1" or as "page 2", but the Arduino doesn't know that.

Ill post my code if needed

Only if you want help.

but it a jumble of mess the way im attempting to do it.

Then, I'd suggest that you are doing it wrong. If you have a function like displayPageOne(), then that function could set the pin that the relay to be toggled is connected to. Similarly, displayPageTwo() could set the pin to a different value.

Then, when the switch is pressed, the appropriate value could be used in the digitalWrite() call.

You are describing a state machine whereby the system can be in one of a finite number of states but only one at a time. Pressing the button will cause the actions for the current state to take place and move the system to the appropriate state. This is most easily implemented using switch/case

set state to 0

start of loop
  switch using state variable
    case 0
      do actions for this state including reading the button(s)
      change state to determine what happens next
    end of case
    
    case 1
      do actions for this state including reading the button(s)
      change state to determine what happens next
    end of case
    
    case 2
      do actions for this state including reading the button(s)
      change state to determine what happens next
    end of case
    
    //etc etc
  end of switch  
end of loop