Though we are not told exactly what method was used in casting lots at various times, it was a way of deciding between one or more persons or as in the case of dividing the land of Canaan among the different tribes, (Josh 14:2).
In Lev 16:1-10 God gives directions as to how Aaron is to choose between the two goats, one to be sacrificed and the other (the scapegoat) to be released. Here are the comments of Adam Clarke, a Hebrew and Greek scholar on this subject.
Verse 8. Aaron shall cast lots upon the two goats] The Jews inform us that there were two lots made either of wood, stone, or any kind of metal. On one was written Mvl LASHSHEM, for the NAME, i. e., hwhy JEHOVAH, which the Jews will neither write nor pronounce: on the other was written lzazel LAAZAZEL, for the SCAPE-GOAT: then they put the two lots into a vessel which was called yplq kalpey, the goats standing with their faces towards the west. Then the priest came, and the goats stood before him, one on the right hand and the other on the left; the kalpey was then shaken, and the priest put in both his hands and brought out a lot in each: that which was in his right hand he laid on the goat that was on his right, and that in his left hand he laid on the goat that was on his left; and according to what was written on the lots, the scape-goat and the goat for sacrifice were ascertained. See the Mishna, in Tract. Yoma.
The determining this solemn business by lot, the disposal of which is with the Lord, Pr 16:33, shows that God alone was to select and point out the person by whom this great atonement was to be made; hence he says: Behold I lay in Zion a stone, elect (that is, chosen by himself) and precious-of infinite value.
The apostles used a method of casting lots to select one to take the place of Judas.
Acts 1:21, Therefore it is necessary that of the men who have accompanied us all the time that the Lord Jesus went in and out among us—
22 beginning with the baptism of John until the day that He was taken up from us—one of these must become a witness with us of His resurrection.”
23 So they put forward two men, Joseph called Barsabbas (who was also called Justus), and Matthias.
24 And they prayed and said, “You, Lord, who know the hearts of all men, show which one of these two You have chosen
25 to occupy this ministry and apostleship from which Judas turned aside to go to his own place.”
26 And they drew lots for them, and the lot fell to Matthias; and he was added to the eleven apostles.
It is not witchcraft.