Get Boolean from another Script, C#

I have already tried to ask this question befor, but let me try aggain:

I want to know an easy way to use a boolean that is toggled in “Script1” in “Script2” (in c#)

This Question was also already asked a 100 times by other people but I just don’t seem to understand…It would be great if someone could help me,

Thank you

If they are on the same gameobject:

//in script1
public boolean toggle

//in script2
if(getComponent<script1>().toggle)
{

}

If they are not on the same GameObject:

//in script1
public boolean toggle

//in script2
//Set this to the other script in the Unity Editor
public script1 otherScript
//...
if(otherScript.toggle)
{

}

Hey there, here is a detailed explanation how access stuff from other script! If you still dont understand specific detailed, sure ask.