Fasting is a means of cleaning out the mind of earthly thoughts and desires
What is the purpose of fasting?
Fasting is a means of cleaning out the mind of earthly thoughts and desires in order to connect to God at a higher , spiritual level and to hear from the Lord. It is a time where we can get alone and ask the Lord "where am I with you" and to separate from the flesh. There are many examples of it in the scri ptures but I am going to limit it to several examples and then draw on the principles found there. The first one is found in Ezra 8.15-30. Ezra is going to lead some of the people back to the land after the Babylonian Captivity and he assembles some of the people to "humble" themselves before God and to pray for a safe journey for themselves, their children and their possessions.
The term "humble" is a Hebraism for fasting and you will see it in Leviticus 23.29 in relation to Yom Kippur or the Day of Atonement and Paul also refers to Yom Kippur as "the Fast" in Acts 27.9. Ezra had been saying to their captors how God’s hand was upon the Jewish people and how He was going to protect them in their journey back to the land so he was embarrassed to ask the king for troops and horseman for additional protection because it would have made the Lord look insufficient, and so Ezra had a problem (Ezra 8.22). You see, they were bringing back gold and silver and the utensils that had been captured from the destruction of the Temple by the Babylonians and they were going to use it again once the Temple was rebuilt, so they were sitting ducks for thieves and robbers, who would immediately see they were traveling unescorted with a virtual treasure. So, in Ezra 8.23 he calls a fast so that God will give them some ideas on how they were to transport all this wealth back to the land. After three days Ezra gets a word from the Lord to divide up the treasure in 12 parts and entrusted it into the hand of some priests and Levites and they wouldn’t have all their eggs "in one basket" in case of an attack. He instructs them to watch and keep the Temple treasure until they arrive in Jerusalem and can give an accounting before the leading priests, Levites and family heads (v 29). So in this case they fasted in order to hear from God on what to do.
In Isaiah 58.1-12 the Lord admonishes the people about their fasting because it had become a mundane performance void of any deeper concerns concerning love, mercy, justice and kindness to others. The Lord was not taking notice of what they were doing because they were oppressing the poor, not supporting their families and pointing the finger at others and supporting false doctrines. He was telling them to stop neglecting the weightier commandments concerning the above things and to start correcting their attitudes. Then they would have the understanding they needed and then He would answer their prayers. In Zechariah 8.19 Israel had added 4 fasts during the year that God never ordained. The Jewish people still observe these today. These self-appointed days of fasting was not going to fix why Babylon came and destroyed the Temple in the first place.
They needed stop mourning the destruction of a building ( the Temple)and find out why God allowed it in the first place, which was due to their callousness, sin, idolatry. They were trying to ingratiate themselves to God by their ritualistic fasting but had missed the point as to why the Babylonians were allowed to defeat them in the first place.
This exact point is brought out in Ezekiel 20.1-49. They had been fasting on one of the self-appointed days mentioned in Zechariah 8 and inquired of the Lord and He tells them that they needed to understand why the Temple and the exile happened. In Ezekiel 24. 16-24 the people are told why the Temple was destroyed, and he tells them not to mourn over it but to examine themselves and to correct what happened, starting with their own hearts.
Another aspect to fasting is seen in the sacrifices performed in the Temple. We read in Leviticus 3. 4,9 that the fat was not to be consumed but burned on the Altar. Now fat has several meanings. First, the fat symbolizes that which is too rich to consume and it is for God alone. We cannot fully understand God’s ways and we need to trust Him. We can "digest" the rich things of God (the fat) in small amounts but most of it is beyond our human comprehension. Secondly, fat is symbolic of pride, prosperity and folly (Psa 17.10; Psa 119.70, Psa 37.20)and it can block our "spiritual arteries" rendering the mind dull, insensitive and oblivious to spiritual truth. The life is in the blood and eating too much fat can cause heart disease, and the same thing happens spiritually.
Earthly prosperity can often be the prelude to destruction in much the same way a calf or sheep is fattened before it is slaughtered. By fasting, we burn not only the natural fat in our bodies but it can also be seen as offering the fat on the Altar and to getting rid of the "spiritual fat" that may have been accumulating around our hearts causing is to be dull and insensitive to the things of God. There is so much more that can be said about fasting and how it should be done but I hope this gives you some idea of how it should be done and the correct attitude we should have while doing it.
It is certainly ordained of God ( Matt 6.16-19) and should never be done unless we are prompted by the Holy Spirit to do it (Matt 4.1-2) and it should be done in order to hear from God about something or when we don’t know what to do. It can be a blessing to us and others when it is done with the proper understanding and attitude and not turned into some mundane, ritualistic act void of any real spiritual reality.