How Do You Change Two Materials Of One Object, And Then Change Them Back?

I’m trying to change the two materials of my object when the mouse hovers over it, and then change them back once the mouse stops hovering over it. Absolutely nothing happens when I play the game so help would be nice. My code is here:
using UnityEngine;

public class Build : MonoBehaviour
{

    public Material hoverColorGrass;
    public Material hoverColorGround;

    private Renderer rend;

    public Material startMaterialGrass;
    public Material startMaterialGround;

    void Start()
    {
        rend = GetComponent<Renderer>();
    }

    void Update()
    {
        void OnMouseEnter()
        {
            rend.materials[0] = hoverColorGrass;
            rend.materials[1] = hoverColorGround;
        }

        void OnMouseExit()
        {
            rend.materials[0] = startMaterialGrass;
            rend.materials[1] = startMaterialGround;
        }
    }
}

Remove OnMouseEnter() and OnMosueExit() from your Update() function

using UnityEngine;

 public class Build : MonoBehaviour
 {
 
     public Material hoverColorGrass;
     public Material hoverColorGround;
 
     private Renderer rend;
 
     public Material startMaterialGrass;
     public Material startMaterialGround;
 
     void Start()
     {
         rend = GetComponent<Renderer>();
     }

     void OnMouseEnter()
         {
             rend.materials[0] = hoverColorGrass;
             rend.materials[1] = hoverColorGround;
         }
 
     void OnMouseExit()
         {
             rend.materials[0] = startMaterialGrass;
             rend.materials[1] = startMaterialGround;
         }
     }
 }

@Isaac_Marovitz I tried what you said and it still didn’t make a difference