We learn in the Tanach that whenever our ancestors and the prophets needed help, they turned to Hashem in prayer.
Avraham Avinu stood in prayer and begged that Sodom not be destroyed. Hashem 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 (Genesis 18). Childless for many years, Yitzchak Avinu and Rivkah Imeinu, pleaded to Hashem in prayer and were answered with the birth of Yaakov and Eisav (Genesis 25). Yaakov Avinu prayed for Hashem to save him from his brother, Eisav, who set out against him with four hundred warriors, and he was answered and saved (Genesis 32). Following the sin of the Golden Calf, Hashem’s wrath rose up against the nation of Israel, and Moshe Rabbeinu prayed intensely until Hashem canceled the decree of disaster that He had threatened to bring on His people (Exodus 32). When Miriam, Moshe’s sister, fell ill with leprosy, Moshe stood and prayed, “Kel na refa na lah” (“O God, please heal her!”) and she was healed (Numbers 12). To turn back a Heaven-sent plague, Aharon used the incense to pray, and the plague ceased (Numbers 17). After the army of Israel was defeated by Ai, Hashem heard Yehoshua’s prayers and guided him to correct the sin of Achan, after which they won their next battles (Joshua 7). When the Philistines waged war against Israel, Shmuel cried out to Hashem for help on behalf of the nation. In answer, Hashem led him and Israel to defeat and conquer the Philistines (I Samuel 7). David, the king of Israel, would often pray to Hashem; his prayers eventually became the Book of Psalms. After Shlomoh finished building the Temple, he prayed that the Shechinah dwell therein, and that all people who pray there would be answered, and Hashem accepted his prayer (I Kings 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 (I Kings 18). Likewise, Elisha the Prophet prayed to Hashem that He revive the son of the Shunamite woman, and the boy came back to life (II Kings 4). When Chizkiyah faced death from his disease, he too prayed to Hashem and was cured (II Kings 20).
One of the prayers that left a lasting impression on all generations is the prayer of Chanah. Barren for years, she would often pray at the Tabernacle in Shiloh and was the first to refer to Hashem in her prayer by the holy name “Tzevakot.” Eventually, she merited a son, none other than Shmuel the Prophet (I Samuel 2). Shmuel the Prophet is said to have been equal to Moshe and Aharon. Through Moshe and Aharon, the word of Hashem was revealed in the transcendental miraculous life of the Jews in the desert and through Shmuel, the word of Hashem was revealed in the tangible reality of the nation of Israel living in Eretz Yisrael. Shmuel unified the nation, founded the kingdom of David, reared a generation of prophets in Israel, and through his inspiration the Temple was built. Shmuel’s great and lofty soul was difficult to bring it down to earth and Chanah needed to pray intensely until she was worthy of giving birth to him. Her prayer is so important that Chazal learn numerous laws from it (Berachot 31a).