Fasting is a spiritual discipline where we give something up—typically food—to focus more deeply on God and express our dependence on Him. Though not commanded, fasting is modeled as a meaningful way to prepare for important decisions and deepen prayer. The Bible warns against fasting with selfish or prideful motives, instead calling us to fast privately and sincerely. Fasting can include other forms of abstinence, like from sex or certain habits, as long as it helps shift our attention from worldly desires to God. Ultimately, fasting is meant to draw us closer to God, not to impress others or prove our devotion.
Fasting is often combined with prayer, especially prayers of particular import (Luke 2:37, 5:33). The main purpose of fasting is not to hunger in a self-punishing way, but to increase one's focus on God. Fasting is meant to express to God, and to ourselves, that our relationship with Him is our main need and nourishment. When fasting, especially from food, it is wise to limit the time spent in the fast. In addition, it is important to consider that some people may not be able to fast from food, such as those with diabetes or other digestive disorders. God does not want us to harm or maim ourselves in an attempt to prove our allegiance to Him. Other variations of fasting outside of just eating no food—such as abstaining from sex, cutting out only certain food groups—and so on, are good. We know from Matthew 6:16-18 that the purpose for fasting is not for us to lord it over others or prove how much we are willing to suffer for God, but to grow closer to Him and experience the resultant peace and joy that is our reward.