We learn in the Tanakh that whenever our ancestors and the prophets needed help, they turned to God in prayer.
The patriarch Avraham stood in prayer and begged that Sodom not be destroyed. God answered him that if there were ten righteous people in Sodom the city would be saved. But ten righteous people were not to be found there, and Sodom was demolished (Bereishit 18). Childless for many years, the patriarch Yitzĥak and matriarch Rivka prayerfully pleaded with God and were answered with the birth of Yaakov and Esav (Bereishit 25). The patriarch Yaakov prayed for God to save him from his brother, Esav, who set out against him with four hundred warriors, and he was answered and saved (Bereishit 32). Following the sin of the Golden Calf, God’s wrath was kindled against the people of Israel, and our teacher Moshe prayed intensely until God canceled the terrible decree that He had threatened to visit on His people (Shemot 32). When Miriam, Moshe’s sister, fell ill with leprosy, Moshe stood and prayed, “Kel na refa na la” (“O God, please heal her!”), and she was healed (Bamidbar 12). To turn back a heaven-sent plague, Aharon used the incense to pray, and the plague ceased (Bamidbar 17). After the army of Israel was defeated by Ai, God heard Yehoshua’s prayers and guided him to rectify the sin of Akhan, after which they won their next battles (Yehoshua 7). When the Philistines waged war against Israel, Shmuel cried out to God for help on behalf of the nation. God answered his prayer, and Israel struck and vanquished the Philistines (1 Shmuel 7). King David of Israel would often pray to God; his prayers eventually became the book of Tehilim. After King Shlomo finished building the Temple, he prayed that the Divine Presence (Shekhina) dwell therein, and that all people who pray there would be answered; God acceded to his prayer (1 Melakhim 8-9). When Eliyahu the Prophet fought against the false prophets of Ba’al on Mount Carmel, he prayed that fire would descend from the sky and so it transpired (1 Melakhim 18). Likewise, Elisha the Prophet prayed to God that He revive the son of the Shunamite woman, and the boy came back to life (2 Melakhim 4). When King Ĥizkiyahu faced death from his disease, he too prayed to God and was cured (2 Melakhim 20).
One of the prayers that left a lasting impression on all generations is the prayer of Ĥana. Barren for years she would often pray at the Mishkan (Tabernacle) in Shilo and was the first to refer to God in her prayer by the holy name “Tzevakot” (“Lord of Hosts”). Eventually, she merited a son, none other than Shmuel the Prophet (1 Shmuel 2). Shmuel the Prophet is said to have been equal to Moshe and Aharon. Through Moshe and Aharon, the word of God was revealed in the transcendental miraculous existence of the Jews in the desert, and through Shmuel, the word of God was revealed in the tangible reality of the people of Israel living in Eretz Yisrael. Shmuel unified the nation, founded the kingdom of David, mentored a generation of prophets in Israel, and inspired the building of the Temple. It was difficult to bring Shmuel’s great and lofty soul down to earth, and Ĥana had to pray intensely until she was worthy of giving birth to him. Her prayer is so important that the Sages learn numerous laws from it (Berakhot 31a and see below, 12:6).