How to access a UI button in the canvas?

How do you access a UI button that is part of a canvas? Do I simply use:

button = GameObject.find("buttonName");

thanks

If you have no reference, yes.

UnityEngine.UI.Button button = GameObject.Find("buttonName").GetComponent<UnityEngine.UI.Button>();