How can I check if a Bool is true from a different script?

I’ve got a script, and I want to check if a bool is true from a different script for an if statement. For example, I want to check if the bool is true, and if it is, I can do stuff. How can I do that?

public ScriptWithTheBoolVariable myScript // Drag & Drop the object with the ScriptWithTheBoolVariable from the inspector

if( myScript.boolVariable ){

    // --- CODE ----
}