using a button witout pressing it ?

so i have made a UI With a back button that disables and enables different gameobjects holding the new page of the ui standard way , andy way basically what i want to is to attach a script to the button gameobject that takes the button component and apply the commands that are set for the onclick without clicking the button but with the input of the return key if(Input.Input.GetButtonDown(return))
{
apply the button code
}

so how can i do this ?

if (Input.GetButtonDown(someKey)) { button.onClick.Invoke(); }

You can see how Unity implements click handling in their open source bitbucket repo.