Fasting and prayer are often paired on special occasions, Acts 13:
On another occasion, the disciples could not cast out a demon. They brought the man to Jesus, and Jesus cast out the demon. Jesus explained their failure in Matthew 17:
It is not just prayer but prayer and fasting to humble ourselves before an important decision. Fasting served to intensify prayer, Acts 14:2 While they were worshiping the Lord and fasting, the Holy Spirit said, “Set apart for me Barnabas and Saul for the work to which I have called them.” 3 So after they had fasted and prayed, they placed their hands on them and sent them off.
In both cases, the disciples fasted before making the crucial appointments that had long-reaching consequences. Fasting solemnizes the souls to listen to God.23 Paul and Barnabas appointed elders for them in each church and, with prayer and fasting, committed them to the Lord, in whom they had put their trust.
On another occasion, the disciples could not cast out a demon. They brought the man to Jesus, and Jesus cast out the demon. Jesus explained their failure in Matthew 17:
There is no guarantee that fasting and prayer will always change an outcome. David committed adultery and murder in 2 Samuel 12:21 “But this kind [of demon] does not go out except by prayer and fasting.”
In the end, the child still died.15 Then Nathan went to his house.
And the Lord afflicted the child that Uriah’s wife bore to David, and he became sick. 16 David therefore sought God on behalf of the child. And David fasted and went in and lay all night on the ground.