I will complement with some experience I had:
I made my game support a controller by using the
focus state. When you click on a
Button control, or a
LineEdit, you may notice a blue circling appear and remain on it (unless you hided it). It means the control has the focus. i.e, it's the currently selected one.
Focus allows to use the keyboard to switch to previous or next control in the UI, sometimes using the arrows keys or the tab key. It does behave semi-automatically already, but you can specify which control to go for all 4 directions on each control, in the inspector.
When a new UI is shown, I usually define which control gets the focus first, using a script. For example, when going to the Settings screen, I call
grab_focus() on the first option. I also made it so my UI understands the "Previous" action, usually bound to the Escape key on the keyboard, which makes it go to whatever previous UI, or closes it.
If you manage to get your UI working this way only with the keyboard, then a controller is easy: instead of arrow keys, you use the D-pad :)