Elkanah's other wife, Peninnah, who evidently had no trouble having children, used to mock Hannah until Hannah was throroughly miserable. Why was Peninnah allowed to mock Hannah in this fashion? Because, I would suggest, Hannah needed to get desperate.
When she got desperate, she went to the temple and prayed. She promised if God would give her a son she would give him to the Lord all the days of his life.
When Eli the high priest saw her lips moving and no sound coming out, he thought she had been imbibing a little too freely and told her to leave off the drink. Hannah explained she was not drunk, but had been praying from the anguish of her soul. Eli blessed her, and prayed her prayer would be answered.
When Hannah left the temple, she wasn't sad any more. She knew she had touched home. She knew her answer was on its way.
When the child was born, she kept the promise she had made to the Lord. When the boy was weaned, she took him to the temple and gave him to Eli. The boy, Samuel, became the prophet in Israel. (You can read the story in 1 Samuel.)
There are two lessons from the story of Hannah. The first is that sometimes an answer to prayer can be delayed until it fits in with God's plans and purposes. The second is that sometimes, instead of just putting up with a situation, we need to get desperate. When we pray like we won't take no for an answer, things begin to happen.
Is that OK?