//Invoked when a button is clicked.
public void Example()
{
//Finds and assigns the child of the player named "Gun".
gun = player.transform.Find("Gun").gameObject;

//If the child was found.
if (gun != null)
{
//Find the child named "ammo" of the gameobject "magazine" (magazine is a child of "gun").
ammo = gun.transform.Find("magazine/ammo");
}
else Debug.Log("No child with the name 'Gun' attached to the player");
}
}

A GameObject with three children. Find() does not find the third child.

// ExampleClass has a GameObject with three spheres attached.
// Two of these are children of the GameObject. The third
// transform, sphere3, is a child of sphere2. Find() does
// not find this child.