We have already said that fasting, according to the New Testament, is an entirely non-compulsory, voluntary act, not a spiritual duty. However, fasting does have some healthy spiritual benefit and is almost always connected with prayer. In Acts 9, Paul spent three days praying and fasting after he had spoken with Jesus on the road to Damascus. It was evidence of his repentance and his humility before God. In Acts 10, Cornelius spent time in prayer and fasting. In fact, he had a vision about Peter during one of his fasts (Acts 10:30). The members of the early church fasted on occasion. The Christians in Antioch fasted (Acts 13:2-3, Acts 14:23). Fasting and prayer was a part of their sincere dedication to know the Lord's will and to follow it.
The Sermon on the Mount records these words of Jesus. “When you fast…” (Matthew 6:16). Of course, this was under the Old Law, but at this point He expected His followers to fast. The thing which Jesus condemns in Matthew 6 is not the fasting, but the attitude the Pharisees had while they were fasting. Jesus didn’t say that their fasting was wrong, but the way it was being done was wrong. There was no humility involved. It was to be seen of men. God always knows the heart.