assigning my Canvas variable to the only Canvas I have in game

hi, I have A canvas named Canvas in my scene and I want to assign it to my Canvas variable via code. I don’t want to make it a public variable and drag it. any idee’s ? I tried GetComponent<> but without succes . ( the script is not attached to the canvas itself btw)

Canvas canvasVariable = GameObject.Find(“name”).GetComponent();

ty that worked