I've been considering a fast and took some time to study a bit yesterday and today. Here are the main themes that I see in the Bible.
In Nehemiah chapter 9, we find the Israelites who had traveled with Nehemiah gathered together, they were fasting and confessed their sins and the guilt of their fathers.
In 1 Samuel 7:2-6, we find the Israelites gathered at Mizpah and Samuel was to pray for them and "they fasted that day, and there they confessed". This was an incident dealing with getting rid of the foreign gods among them.
In 1 Kings chapter 21 we find a king of Samaria named Ahab-he wants a field next to his palace that belongs to someone else. The owner refuses to sell it to him at any price and a plot is put together to have the owner falsely testified against and the owner is stoned to death. The prophet Elijah speaks against Ahab; Ahab "tore his clothes, put sackcloth over his body, and fasted". The Lord, said that since he humbled himself, he would not bring the disaster he planned during Ahab's lifetime.
Following the death of Saul, the brave men retrieved his body and the bodies of his sons...and they fasted seven days (1 Samuel 31:11-13). This fasting was a sign of respect for the King and his sons. David also fasted following the death of Bathsheba's son (2 Kings 12:15-16).
In Psalm 35:13, David says: "Yet When they were sick, my clothing was sackcloth; I humbled myself with fasting, and my prayer was genuine." In Matthew chapter 17, the disciples were unable to drive out a demon and Jesus explained that "this kind does not come out except by prayer and fasting" (v21)
Of course, much more can be said of fasting. Esther had Mordecai call all the Jews to fasting to grant her favor from God (Esther chapter 4); Daniel ate only vegetables while held captive and refused to eat the king's food; and Jesus fasted for forty days while being tempted in the wilderness following his baptism.
select one here...