How to decrease the speed of the player by some fraction after triggering the box collider?

I am making a game where a player is running and collecting foods. As soon as he touches the food which has box collider, I want the speed of the player to decrease by some fraction. How to achieve this? I have decreased the speed inside OnTriggerEnter() but the speed is not getting decreased

Player is moving to destination following different nodes path. The NextPos is used to determine the position of those nodes.

Script is like this:

//NextPos is the transform for the different places. 
.....
public float tempSpeed;
....

void update()
{
    transform.position = Vector3.MoveTowards(transform.position, NextPos.position, tempSpeed * Time.deltaTime);
}

public void OnTriggerEnter(Collider other)
{
    if (other.gameObject.CompareTag("Food"))
    {
        other.gameObject.SetActive(false);
        tempSpeed = tempSpeed - (0.1f * tempSpeed);  
    }
}

I want to decrease the speed of player for every food touched.
169822-screenshot-237.png

Obvious questions… Just to check, have you set the “is Trigger” on the player colliders and made sure the tags on the food are correct?

I have now actually figured out the solution. The above code is completely working fine. Due to complexity for making the game, I have actually used two public variables for denoting the speed of player, one is Speed and other is tempSpeed. Speed contains the values typed by user in the inspector and tempSpeed is just the reference to that speed. I thought while moving the player, Speed variable will hold the initial value typed by user in inspector and tempSpeed will be used to decrease the speed of the player. But it did not worked out and now I have completely removed the public variable Speed and only tempSpeed variable is being used to define the speed of player. Its now working fine according to my need.

Another mehod:
Also, making one variable private out of the two worked fine. In my case I made Speed variable private which is only used to reference the original speed typed by the user so that once tempSpeed becomes less than 0, tempSpeed will again becomes Speed (original value).
Thanks for all the replies!!!