How do I check if bool is true from another script?

Hi I have one script that says:

public bool IsLightOn = true;

and then I have another script, that should be something like this:

If (IsLightOn = true)
{
 // Do Stuff
}

But that wont work because the IsLightOn bool is in another script, how can I make the other script “get” the bool from the other script?

Thanks, Andreas.

if (GameObject.Find(“name of the gameobject holding the script with the bool”).GetComponent().IsLightOn) //will check if true

if (!GameObject.Find("name of the gameobject holding the script with the bool").GetComponent<name of the script holding the bool>().IsLightOn) //will check if false

If your both scripts are on the same gameobject. don’t use Find.

if (gameObject.GetComponent<name of the script holding the bool>().IsLightOn)//will check if true

if (!gameObject.GetComponent<name of the script holding the bool>().IsLightOn)//will check if false

??
cant see?