How do i access text property of Canvas UI button through code?[C#]

I’ve searched but i could not find any leads on this sorry for the simple question but i would like to know cause i’ m working on a level selector and i want to access the text of the UI button and the background/Image color of the UI button through c#.

Thanks in advance,
15 year old aspiring dev

At the beginning of your script:

using UnityEngine.UI;

Then:

Text myText = GetComponent <Text>();