So he was there with the Lord forty days and forty nights; he neither ate bread nor drank water. And He wrote on the tablets the words of the covenant, the Ten Commandments. Exodus 34:28 NKJV
Often in the Bible, God's people fasted and prayed immediately before a major victory, miracle, or answer to prayer. It prepared them for a blessing!