We need to maintain a close, personal relationship with our Father in heaven if we are to have any chance at resisting evil. Fasting draws us into a closer relationship with God and sharpens our focus to seek His perfect will in our daily lives.
Sometimes a fast is needed in order to petition God and to seek his favor for others. The early New Testament church fasted and prayed for Paul and Barnabas' ministry (Acts 13). Early believers also fasted and prayed when choosing leaders in the church (Acts 14:23). David fasted for the life of his baby through Bathsheba after he had committed adultery with her then set up having her husband killed in battle (2Samuel 12:15-16, 22). The people of Nineveh, a gentile nation, fasted for God's mercy (Jonah 3).
Lastly, contemporary dietary science is only now becoming aware of the health benefits of fasting. Recent studies done at the United States National Institutes of Science indicating that longer life, resistance to diabetes and other illness and better weight control are the results of moderate program of fasting.
How often should we fast?
Christians are commanded by God to fast at least one day a year, during the holy day known as the Day of Atonement (also called Yom Kippur - Leviticus 23:32). We should, however, try to fast a few times each year. Paul fasted on a regular basis (2Corinthians 11:27). Jesus did not eat or drink for forty days so that he could fully resist the temptations of the devil. We should fast whenever we feel the need to seek God, become aware of our need to be strengthened spiritually or to petition God for the good of others.
The first thing one should do is stop drinking anything with caffeine in it, coffee, regular black tea (herbal teas may be beneficial) or soda pop in the week preceding any fast. Instead, one should drink pure filtered water (not bottled) just before you begin your fast so you will be adequately hydrated and will not get a headache or other ailments.
With certain kinds of health conditions (such as diabetics, etc.), you should consult with a doctor or other medical professional before going, for any period of time, without food or water.
Fasting is meant to be a private act between us and God. We are warned by Jesus himself not to be proud of or boast to others that we are fasting in the hope they will think we are 'spiritual' and close to God (Matthew 6:16-18). It is also important to remember that fasting is not an end unto itself. It should, of course, draw us close to God and focus our minds to think like he does. But it should ultimately lead us to help those who are oppressed, feeding those who are hungry, providing shelter for those who have none, and giving clothes to those who are in grave need (Isaiah 58:6-7).