Fasting is used as a way to petition God and we see it mentioned many times in the Gospel. In fact, we can conclude that Jesus expects us to fast. Fasting is meant to draw us closer to God, it is a spiritual experience in addition to a physical one. Or we could say that the 2 going hand in hand has an even deeper spiritual meaning. We are humbling ourselves to God and showing Him that we rely on Him more than the world around us. Reasons to fast could include mourning, amplifying a request or for repentance.
At the Sermon on the Mount, Jesus says: “And when you fast, do not look dismal, like the hypocrites, for they disfigure their faces that their fasting may be seen by men. Truly, I say to you, they have received their reward. But when you fast, anoint your head and wash your face, that your fasting may not be seen by men but by your Father who is in secret; and your Father who sees in secret will reward you” (Matt. 6:16–18; cf. Mark 2:18–20)
General "rules" of fasting include: