Changing pickup on mouse click yo button press

I have some code for picking up an item on mouse click but I plan on removing the mouse functionality. Does anyone know how I could edit this to make it on button press instead of a mouse click on the object?

Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
if (Input.GetMouseButtonDown(0))
{
if (hit.transform.GetComponent())
{
Pickup item = hit.transform.GetComponent();
if (PickupDistance(item) <= item.GetPickupRadius())
item.PickupItem();
}
}
}

Thanks,
Dan

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: https://discussions.unity.com/t/481379

This may be helpful to you:

https://docs.unity3d.com/ScriptReference/Input.GetKeyDown.html