The code fails to generate the values I want, when both trigger pins 2, 3 are high or low. Why?
To send anything to serial you need to initialize it first with:

void setup()
{
    Serial.begin(115200);
    //other code
}


And you are using wrong quotes for the string.
They should be double quotes " not single ones '.

Also you could simplify your code, if you removed the third if, since it's just checking the already known state at that point.

You should also read the button state only once, save them into a variable and then just compare those variables.

bool button1_state = digitalRead(2);
bool button2_state = digitalRead(3);
if (button1_state &amp;&amp; !button2_state) {
    infra();
}
else if (!button1_state &amp;&amp; button2_state) {
    red();
}
else {
    Serial.println("help");
}