The practice of casting lots was completed by throwing sticks or stones with markings or symbols into a closed-off space to determine the will of God. It was used by Jews throughout the Old Testament, and even Jesus Christ's disciples in the New Testament until Pentecost.
The way that the "lots" landed would be interpreted by someone present, usually a person considered close to God or learned in scripture. The casting of lots was typically used when a big decision had to be made but there was insufficient information or guidance in the scriptures. Throughout the Bible, neither God nor Jesus nor any agent of them denounced casting lots, but after Pentecost, which is said to have brought the presence of the Holy Spirit to God's people to help guide them, the casting of lots was no longer necessary.