The Talmud derives multiple laws of proper prayer from Channah's prayer in I Samuel, including that she spoke from the depths of her heart (she moved her lips but her voice was not heard), that prayer requires inner devotion and seriousness, and that one must not approach Shemoneh Esrei in a state of levity.
תָּנוּ רַבָּנַן: אֵין עוֹמְדִין לְהִתְפַּלֵּל לֹא מִתּוֹךְ עַצְבוּת, וְלֹא מִתּוֹךְ עַצְלוּת, וְלֹא מִתּוֹךְ שְׂחוֹק, וְלֹא מִתּוֹךְ שִׂיחָה, וְלֹא מִתּוֹךְ קַלּוּת רֹאשׁ, וְלֹא מִתּוֹךְ דְּבָרִים בְּטֵלִים, אֶלָּא מִתּוֹךְ שִׂמְחָה שֶׁל מִצְוָה. תָּנוּ רַבָּנַן: הַמִּתְפַּלֵּל צָרִיךְ שֶׁיְּכַוֵּין אֶת לִבּוֹ לַשָּׁמַיִם. אַבָּא שָׁאוּל אוֹמֵר: סִימָן לַדָּבָר, ״תָּכִין לִבָּם תַּקְשִׁיב אׇזְנֶךָ״. אָמַר רַב הַמְנוּנָא: כַּמָּה הִלְכְתָא גִּבָּרָווֹתָא אִיכָּא לְמִשְׁמַע מֵהָנֵי קְרָאֵי דְחַנָּה. ״וְחַנָּה הִיא מְדַבֶּרֶת עַל לִבָּהּ״ — מִכָּאן לַמִּתְפַּלֵּל צָרִיךְ שֶׁיְּכַוֵּין לִבּוֹ. ״רַק שְׂפָתֶיהָ נָּעוֹת״ — מִכָּאן לַמִּתְפַּלֵּל שֶׁיַּחְתּוֹךְ בִּשְׂפָתָיו. ״וְקוֹלָהּ לֹא יִשָּׁמֵעַ״ — מִכָּאן שֶׁאָסוּר לְהַגְבִּיהַּ קוֹלוֹ בִּתְפִלָּתוֹ. ״וַיַּחְשְׁבֶהָ עֵלִי לְשִׁכֹּרָה״ — מִכָּאן שֶׁשִּׁכּוֹר אָסוּר לְהִתְפַּלֵּל.
On the topic of proper preparation for prayer, the Sages taught: One may neither stand to pray from an atmosphere of sorrow nor from an atmosphere of laziness, nor from an atmosphere of laughter, nor from an atmosphere of conversation, nor from an atmosphere of frivolity, nor from an atmosphere of purposeless matters. Rather, one should approach prayer from an atmosphere imbued with the joy of a mitzva. Returning to the topic of preparation for prayer, the Sages taught in the Tosefta: One who prays must focus his heart toward Heaven. Abba Shaul says: An indication of the importance of this matter is stated in the verse: “The desire of the humble You have heard, Lord; direct their hearts, Your ear will listen” (Psalms 10:17). In other words, if one focuses his heart in prayer as a result of God directing his heart, his prayer will be accepted as God’s ear will listen. Rav Hamnuna said: How many significant halakhot can be derived from these verses of the prayer of Hannah? As it says: “And Hannah spoke in her heart, only her lips moved and her voice could not be heard, so Eli thought her to be drunk” (I Samuel 1:13). The Gemara elaborates: From that which is stated here: “And Hannah spoke in her heart,” the halakha that one who prays must focus his heart on his prayer is derived. And from that which is stated here: “Only her lips moved,” the halakha that one who prays must enunciate the words with his lips, not only contemplate them in his heart, is derived. From that which is written here: “And her voice could not be heard,” the halakha that one is forbidden to raise his voice in his Amida prayer as it must be recited silently. From the continuation of the verse here: “So Eli thought her to be drunk,” the halakha that a drunk person is forbidden to pray. That is why he rebuked her.