choose random gameobject from a gameobject list

C#
 void Fire()
 {
          if(Logs.Count == 0) 
          {
               CancelInvoke();
               return;
          }
          int randomIndex = Random.Range(0, Logs.Count);
          Logs[randomIndex].transform.position = transform.position;
          Logs[randomIndex].transform.rotation = transform.rotation;
          Logs[randomIndex].SetActive(true);
          Logs.RemoveAt(randomIndex);
  }


Source

Also in C#: