What is the command to stop the Update function ingame? (c#)

So i want an object ingame to pass a trigger and stop the update function on a script. How do i do this? i know how to make a trigger to something, but i dont know what the command to stop the Update function is.

Just set enabled (variable that every MonoBehaviour have) to false.

using UnityEngine;

public class MyClass : MonoBehaviour
{
    private void Start()
    {
        enabled = false;
    }

    private void Update()
    {
        // Update() will not be called if enabled equals false.
    }
}