The act of fasting is simply going without food, drink or both for a period of time. Christians have done it in the past as an act of prayer, penitence, a show of faith... there were many reasons why it was done. In fact, there are lots of cases of Biblical figures fasting. Jesus himself fasted for 40 days and 40 nights in the desert - this is commonly known as the Temptation of Christ.
These Bible verses about fasting will hopefully explain to you why and when people fast.