If I have 2 OnGUIs how can I only call one?

For Example:

OnGUI()
{
OnGUI.Button(Rect(10, 10, 10, 10), (“hi”);
}

OnGUI()
{
OnGUI.Button(Rect(10, 10, 10, 10), (“bye”);
}

How can I distinguish between the 2 and only call one?

You cannot have multiple OnGUI calls on one object. If you want to have two OnGUI functions, you need two different objects, and then you’d enable the one you wanted to be active, and disable the other.

Either that or you could have a bool in your OnGUI function that switches between the two.

for example, in your situation, you could easily solve the hi/bye problem with a bool like so:

bool sayHi = false;

OnGUI() 
{ 
    string message = "";
    if (sayHi)
        message = "hi";
    else
        message = "bye";
    OnGUI.Button(Rect(10, 10, 10, 10), message); 
}

bool greeting;

OnGUI() { 
    if ( greeting ) {
        if ( OnGUI.Button(Rect(10, 10, 10, 10), ("hi")) )
            //do stuff
    } 
    else if ( OnGUI.Button(Rect(10, 10, 10, 10), ("bye")) )
        //do stuff

}

If you want multiple buttons to overlap, you could also use a switch statement to determine which Button gets displayed.

int option;

OnGUI() { 
    switch ( option ) {

        case 0: if ( OnGUI.Button(Rect(10, 10, 10, 10), ("hi")) );
                //do stuff
                break;
    
        case 1: if ( OnGUI.Button(Rect(10, 10, 10, 10), ("bye")) );
                //do stuff
                break;

        case 2: if ( OnGUI.Button(Rect(10, 12, 8, 13), ("Whatever you want")) );
                //whatever you want
                break;
    } 
}