It is clear that God expects fasting to be a private matter between you and Him. Most importantly, God Himself defines what he expects in the Book of Isaiah:
"Is this such a fast that I have chosen? A day for a man to afflict his soul? Is it to bow down his head like a bulrush, and to spread sackcloth and ashes under him? Will you call this a fast and a day pleasing to the LORD?
"Is not this, rather, the fast that I have chosen - to loose the bands of wickedness, to undo the heavy burdens, and to let the oppressed ones go free, and that you break every yoke?
"Is it not to give of your bread to the hungry, and that you should bring home the wandering poor? When will you see the naked and cover him; and not hide yourself from your own flesh?" (Isaiah 58:5-7)
In the days of Isaiah, when the nation of Israel was fasting, they did it for their own personal deliverance, but they were not concerned for other people around them that were starving, naked, and homeless. God wanted them to have a heart, to focus about other people's spiritual needs as well as their own, and to bring forth good works of helping the needy. God is telling us that to not eat or drink brings us closer to his will, and His will is to have humility, love, and concern for others. With this type of attitude and good works, God promises,
"Then you shall call, and the LORD shall answer; you shall cry, and He shall say, ‘Here I am.’" (Isaiah 58:9)
This is the most important principle, to draw closer to God and to seek His righteousness and His will in our lives.
How often should we fast?
Performing a fast should be a regular part of a Christian's life, not just on God's Holy Day known as the Day of Atonement (Leviticus 23:32), but several times in a year. The Bible says that Paul did this often (2Corinthians 11:27, Acts 9:9). The Apostle Paul knew that fasting would be a way of life for Christians (1Corinthians 7:5). Christ did not eat or drink for forty days and nights to prepare Himself for the time that He would come face to face with Satan because He knew He would need His Father's strength. Fasting is a tool that God has given us to use to become spiritually stronger so that we can go on our spiritual journey with strength and power from God, instead of having very little spiritual strength.
Why do it?
One reason that fasting is a part of being a Christian is that the world we live in is saturated with evil. Like in the days of Sodom and Gomorrah, we can be overtaken by the evil that surrounds us. As the apostle Peter said:
"And if He personally rescued righteous Lot, who was oppressed by the lawless ones living in licentious conduct; (For that righteous man, dwelling among them, through seeing and hearing their lawless activities, was tormented day by day in his righteous soul" (2Peter 2:7-8)
Christians not only need to study and pray, but also need to fast to fortify and maintain a close relationship with God. Going without such necessities of life helps Christians to seek God's righteousness, His wisdom, His will, and His strength in a world that is overcome with evil. If you feel you are not very close to God and things are not going right for you physically or spiritually, that your prayers are not going higher than the ceiling, then fast!
Before you fast, it is best to ask God to help you to be effective and fervent while you do this. I believe the best way to do this is to alternate between prayer, studying, and a period of meditation throughout the day. Praying is when we talk to God, and studying His word is like God talking to us. Fasting is like receiving a spiritual vitamin shot that gives you more spiritual strength to grow in God's righteousness.
Believers fast to have a true godly repentance of sin. David fasted because of the sin he committed with Bathsheba (2Samuel 12:15-16, 22). God accepted David's effort and forgave him. In the Old Testament Nineveh, a gentile nation, was guilty of sin and God had intended to destroy their city. Incredibly, the King commanded every person and beast to go without food and water in order to beseech God's mercy and to forgive them:
"And the Word of the LORD came to Jonah the second time, saying, 'Arise, go to Nineveh, that great city, and cry out to it the proclamation that I am declaring to you.' And Jonah arose and went to Nineveh, according to the Word of the LORD. And Nineveh was a very great city of three days’ journey across. And Jonah began to enter into the city a day’s journey, and he cried and said, 'Yet forty days and Nineveh shall be overthrown!'
"And the people of Nineveh believed God. And they proclaimed a fast, and put on sackcloth, from the greatest of them even to the least of them, for word came to the king of Nineveh, and he arose from his throne. And he laid aside his robe from him, and covered himself with sackcloth, and sat in ashes. And he caused it to be proclaimed and published through Nineveh by the decree of the king and his great ones, saying, 'Do not let man or beast, herd or flock taste anything; do not let them feed, nor drink water. But let man and animal be covered with sackcloth, and cry mightily to God. And let them each one turn from his evil way, and from the violence that is in their hands. Who knows? God may repent, and He may have pity and turn away from His fierce anger, so that we do not perish.'
"And God saw their works, that they turned from their evil way. And God repented of the evil that He had said He would do to them, and He did not do it." (Jonah 3)
Why would someone go without food and water?
Not all examples of fasting in the Bible are for repentance. The whole church in the New Testament went without food or water for the ministry of Paul and Barnabas (Acts 13:2-3). It was part of appointing the elders of the church:
"And when they had chosen for themselves elders in every church, and had prayed with fasting, they committed them to the Lord, on Whom they had believed." (Acts 14:23).
Daniel fasted that God would deliver Israel from slavery (Daniel 9:3). A gentile king even fasted for Daniel when he was thrown into a lion's den (Daniel 6:18). Moses fasted forty days and nights to draw close to God (Exodus 34:27-28). King David did not eat or drink for his sick friends (Psalm 35:13). Christ said the only way to cast out difficult demons was through prayer and fasting:
"And when He came into a house, His disciples asked Him apart, 'Why were we not able to cast it out?' Then He said to them, 'This kind cannot be made to go out by anything except prayer and fasting.'" (Mark 9:28-29)
Anna the Prophetess (Luke 2:3) carried out a fast - praying night and day (she was 84 years old!). In some health conditions (diabetics, etc.), one may want to consult a doctor for medical advice before not eating or drinking for an extended period of time. True Christians cannot go forth in power to do the Work of God unless it also becomes literate in the Bible and a fasting and praying church.