The Lord promises to reward us when we fast the right way
16 "When you fast, do not look somber as the hypocrites do, for they disfigure their faces to show men they are fasting. I tell you the truth, they have received their reward in full. 17 But when you fast, put oil on your head and wash your face, 18 so that it will not be obvious to men that you are fasting, but only to your Father, who is unseen; and your Father, who sees what is done in secret, will reward you.
Moses twice fasted for 40 days. Obviously, he was enabled by the power of the Lord.
28 Moses was there with the LORD forty days and forty nights without eating bread or drinking water. And he wrote on the tablets the words of the covenant-- the Ten Commandments.
9 When I went up on the mountain to receive the tablets of stone, the tablets of the covenant that the LORD had made with you, I stayed on the mountain forty days and forty nights; I ate no bread and drank no water.
18 Then once again I fell prostrate before the LORD for forty days and forty nights; I ate no bread and drank no water, because of all the sin you had committed, doing what was evil in the LORD's sight and so provoking him to anger.
Elijah went 40 days and nights on the strength of the meal God gave him.
I Kings 19:7-8
7 The angel of the LORD came back a second time and touched him and said, "Get up and eat, for the journey is too much for you." 8 So he got up and ate and drank. Strengthened by that food, he traveled forty days and forty nights until he reached Horeb, the mountain of God.
God even honored a fast by Ahab.
I Kings 21:27-29
27 When Ahab heard these words, he tore his clothes, put on sackcloth and fasted. He lay in sackcloth and went around meekly. 28 Then the word of the LORD came to Elijah the Tishbite: 29 "Have you noticed how Ahab has humbled himself before me? Because he has humbled himself, I will not bring this disaster in his day, but I will bring it on his house in the days of his son."
Daniel had a partial fast.
2 At that time I, Daniel, mourned for three weeks. 3 I ate no choice food; no meat or wine touched my lips; and I used no lotions at all until the three weeks were over.
The Ninivites fasted with repentance and prayer for three days after Jonah's proclamation of God's judgement. And the Lord spared them.
Esther called for the Jews to fast and pray for deliverance for three days. The Lord delivered them.
16 "Go, gather together all the Jews who are in Susa, and fast for me. Do not eat or drink for three days, night or day. I and my maids will fast as you do. When this is done, I will go to the king, even though it is against the law. And if I perish, I perish." 17 So Mordecai went away and carried out all of Esther's instructions.
A missionary in Chile fasted each morning during the breakfast hour for the removal of the Marxist president, Salvador Allende. On September 11, 1973, she woke up and felt that God wanted her to end her fast and eat breakfast that day. Later that day, the dictator was overthrown.
Jesus fasted and prayed for 40 days after He was baptized and the Spirit came upon Him.