John Piper, in a sermon, “Set Apart Rick, Randy, and the Rest for the Work” said:
Notice: The Holy Spirit “calls,” and the leaders of the church “set apart.” Both are important. The divine work and the human work. But they are not separate. The divine work of the calling is perceived in a human heart and mind. And the human work of setting apart is done with prayer to God and fasting, as you can see in verse 3: “Then, when they had fasted and prayed and laid their hands on them, they sent them away.” In other words, all along the way God is taking up the human into his purposes by calling, and the human is relying on God in prayer and fasting.
Surely it is no mere coincidence that they were fasting and worshiping when the word from the Holy Spirit was made plain: Set apart Barnabas and Saul for the work I have called them to. God acts in worship to spread worship. That’s what is happening here. Barnabas and Saul are going to leave the worshiping community.