how do i stop my globe from rotating with the click of a button?

i have a globe which is always spinning, what i want to happen is when the user/player hits a UI button the globe stops spinning, and then when they hit the same button again it should continue to spin.

using UnityEngine;
using System.Collections;


public class EarthSpinScript : MonoBehaviour {
    public float speed = 10f;
    
    
    
    

    void Update() {
        transform.Rotate(Vector3.up, speed * Time.deltaTime, Space.World);


    }





}

this is the code i have for the spinning of the globe

i am a bit of a beginner at this so when i have searched for a solution i guess i just dont understand enough what to do! any help is appreciated!

thank you in advance!

Add this to your script, then in the OnClick() event of the button add this function:

public void PauseUnpause()
{
      enabled = !enabled;
}

**Clarification: ** Update() function only works if the script is enabled, so just by enabling/disabling the script is enough.