John 19:24
24 So they said to one another, “Let us not tear it. Instead, let us cast lots to see who will get it.” This was to fulfill the Scripture:
“They divided My garments among them,
and cast lots for My clothing.”
So that is what the soldiers did.