How do you check if a game object is set active using an if statement?

I am trying to check whether or not a game object is set active using an if statement but whenever I try to unity says that I cant do it because it is a “group method” so I am trying to figure out how to do the same thing but using a different method.

Here is the code i have:

public class Pause_controls : MonoBehaviour
{

    bool disabled;
    public GameObject panelE;

    // Start is called before the first frame update
    void Start()
    {
        disabled = false;
    }

    // Update is called once per frame
    void Update()
    {
        Controls();
        if (disabled == true)
        {
            keybinds();
        }
    }

    void Controls()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            disabled = true;
        }
    }
    
        void keybinds()
    {
        if (Input.GetKeyDown("r"))
        {
            restart();
        }
        else if (Input.GetKeyDown(KeyCode.Backspace))
        {
            exit();
        }
        else if (Input.GetKeyDown("t"))
        {
            Sc();
        }
        else if (Input.GetKeyDown("f"))
        {
            menu();
        }
    }

        void restart() {...
        void exit() {...
        void Sc() {...
        void menu() {...
    
}

see Unity - Scripting API: GameObject.activeSelf
You could use

if (panelE.activeSelf)
{
    Debug.Log("panelE active");
}
else
{
    Debug.Log("panelE not active");
}

If you’re using GameObject.SetActive(), this is a method that sets a gameobject’s active state to true or false. The bool for whether it is active in the scene or not is GameObject.activeInHierarchy. Check doc here

@Klepzy