how to select UI button with script

So i have a question. I would like to select another button when i click a button, with a script, not with UI navigation.

the script should look like this:

public GameObject ButtonToSelect; public void OnButtonClick () { //Select the button }

I probably miss only one line of code, I read documentation but fould nothing about this.
woud lt be possible to please help me?

kind Regards,

so the problem was resolved by myself

if you want to select a button on click you can use this script:

using UnityEngine;
using UnityEngine.UI;

public class destinationButton : MonoBehaviour

public void DestinationButton(Button destinationButton)