[HELP] How to disable objects by tag name "Block" using button

This is the script far i have done but i am keep getting error can someone help me out please

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CubeEnable : MonoBehaviour {

private GameObject cubeObject;

void Start()

{
    cubeObject = GameObject.FindGameObjectWithTag("Cube");
    Disable();
}


public void Disable()
{
    cubeObject.SetActive(false);
}

public void Enable()
{
    cubeObject.SetActive(true);
}
}

// THIS IS THE ERROR I AM GETTING IN CONSOLE

NullReferenceException: Object reference not set to an instance of an object
CubeEnable.Enable () (at Assets/Scene/Scripts/CubeEnable.cs:25)

Is this object active in your scene? If it isn’t, the Start function won’t fire, and cubeObject won’t be defined, and the disable and enable functions can’t set active something which is not defined.

How is your hierarchy set up. Is this script you posted on a different GameObject from the cubeObject? If its not, as soon as you SetActive(false) you won’t be able to turn it back on since its script doesn’t work anymore.

If they are separate scripts on separate GO’s. You disable the cube right off the bat, which doesn’t seem to cause an error. What is calling Enable method, a button somewhere? Do you have more than one copy of the CubeEnable script in your scene?