Fasting is an ascetically practice recommended in the scriptures and the writings of the church fathers. It is sometimes prescribed by a precept of the church, especially during the liturgical season of Lent, which is why we're doing it now. If you look through scripture, you'll see that fasting is mentioned throughout as an aid to prayer.
