Need help with my code.

Can someone help me with my code here.

I am doing a 2D car racing game. When car goes off the road onto the grass it’s speed goes from 10 to 3. I have successfully been able to make that happen. But now when the car goes from the grass into the mud it’s speed should go from 3 to 1. This code I am not able to implement. Could someone help me with this?
Is my code wrong or is it because I have two trigger on top of each other?

void OnTriggerStay(Collider other)
	{
		if(other.tag == "Grass")
		{
			speed = grassSpeed;
		        if (other.tag == "Mud")
			      {
				    speed = mudSpeed;
			      }
		}
		
	}

Consider logically the if-sentences. You have the other.tag == “Mud” condition nested inside the one that tests to see if other.tag == “Grass”. Therefore, when execution gets to this point in code, it will have already determined that other.tag equals “Grass”. Since that is the case, it can never equal “Mud”, and thus, speed never gets set to mudSpeed.

You should move that if-sentence outside the one that tests for grass:

void OnTriggerStay(Collider other)
{
    if (other.tag == "Grass")
    {
        speed = grassSpeed;
    }
    else if (other.tag == "Mud")
    {
        speed = mudSpeed;
    }
}