The practice of casting lots to make decisions or to obtain an answer is mentioned many times in the Bible - mostly in the Old Testament but there are a handful of references to this practice in the New Testament.
The purpose of casting lots is told to us in Proverbs 18:18.
Casting the lot ends quarrels and separates powerful opponents.
The Bible isn't specific about the actual lots themselves. Were they sticks of varying lengths, or flat stones, or maybe white stones with a black stone thrown in, or some kind of dice? We just don't know, but it seems it would be similar to flipping a coin, or throwing dice or drawing names from a hat.
In the Old Testament casting lots was used for many reasons. The most frequent was to divide the land as specified in Numbers 26:55 - But the land shall be divided by lot. Joshua divided the land by casting lots in Joshua 18:8-10. "... then I will cast lots for you here before the LORD in Shiloh." ... And Joshua cast lots for them in Shiloh before the LORD, and there Joshua divided the land to the sons of Israel according to their divisions.
They also used casting lots to determine various duties. In 1 Chronicles 25:8 The cast lots for their duties, all alike, the small as well as the great, the teacher as well as the pupil. In Nehemiah 10:34 they cast lots for who would supply wood. In Leviticus 6:13 the Old Testament law commanded that "Fire must be kept burning on the altar continually; it is not to go out." This required a lot of wood! The people shared the responsibility for providing this wood. In Nehemiah 11:1 they cast lots to see which families would move to Jerusalem!
One of the most intriguing uses of casting of lots was to determine who had sinned. We see this in 1 Samuel 14:24-45 when the lot was cast between Saul and Jonathan and Jonathan was selected. Jonathan admitted his sin. And we see it in Jonah 1:7 when the pagan sailors cast lots to see who was responsible for the storm and it selected Jonah.
Casting lots was a practice not only used by the Hebrews but also by people of other cultures such as these pagan sailors and also the Roman soldiers when they cast lots for Jesus' garments. This is recorded in all four gospels - Matthew 27:35, Mark 15:24, Luke 23:34, and John 19:24. The phrase they divided His clothes and cast lots fulfilled Psalm 22:18. Psalm 22 is quoted more frequently in the New Testament than any other Psalm because it has many messianic prophecies. What is also interesting is that Psalm 22:18 was written about 1000 years before Jesus was crucified!
One last example of casting lots needs to be mentioned to make a point. It is found in Acts 1:26 where casting lots was how the apostles decided who would replace Judas. They drew lots and the lot fell to Matthias. He was added to the eleven apostles. Back up to the preceding verses. They had put two men forward to be the possible replacement.
And they prayed and said, "You, Lord, who know the hearts of all men, show which one of these two You have chosen to occupy this ministry and apostleship from which Judas turned aside to go to his own place." And then they cast lots.
Lots were used to seek God's will. Joshua cast lots before the LORD. Saul prayed before the lot was cast. The apostles prayed to the Lord before they cast their lots.
It reminds me of my women's Bible study group where we had a bowl of names in it. I would ask the ladies to say a quick prayer before they drew a name. Then in the next week they were to reach out to that woman whose name they drew and encourage her in some way. We called these our encouragement cards. There was nothing random about whose name they got. We prayed and we were trusting God to give us the name we were to encourage.
The Hebrew people asked God to be a part of the process.
Casting lots is not an occult practice. Occult practices are condemned by God as spelled out in Deuteronomy 18:10-12. Divination is the practice of seeking knowledge of the future by supernatural means.
The Hebrew people were seeking God's will.
However, we no longer need to cast lots to determine God's will. Nowhere in the New Testament does it instruct Christians to cast lots to make decisions. After the lot fell on Matthias to be the twelfth apostle, casting lots is not mentioned again. Why? Because Pentecost occurred and the Holy Spirit became indwelling in believers.
If we want to know God's will, we have God's Word and the Holy Spirit to guide us, prayer and fasting.