Limit of a move for position

i used transform.position for change the position, but i dont wanna that the player move if have a object in desired position
3d game

void Update()
{
  if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            transform.position += new Vector3(-67, 0, 0);
            
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            transform.position += new Vector3(67, 0, 0);
            
        }
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            transform.position += new Vector3(0, 0, -56);
           
        }
        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            transform.position += new Vector3(0, 0, 56);
            
        }
     }

Sounds like you want collisions. The simplest way to do this is the CharacterController. The documentation has a very simple script to do exactly this.