1 Samuel 1 (Excerpted):
...but Hannah had no children.
...
And she was in bitterness of soul, and prayed unto the LORD, and wept sore.
And she vowed a vow, and said, O LORD of hosts, if thou wilt indeed look on the affliction of thine handmaid, and remember me, and forget not thine handmaid, but wilt give unto thine handmaid a man child, then I will give him unto the LORD all the days of his life, and there shall no razor come upon his head.
...
Then Eli [the priest] answered and said, Go in peace: and the God of Israel grant thee thy petition that thou hast asked of him.
And she said, Let thine handmaid find grace in thy sight. So the woman went her way, and did eat, and her countenance was no more sad.
And they rose up in the morning early, and worshipped before the LORD, and returned, and came to their house to Ramah: and Elkanah knew Hannah his wife; and the LORD remembered her.
Wherefore it came to pass, when the time was come about after Hannah had conceived, that she bare a son, and called his name Samuel, saying, Because I have asked him of the LORD.
See also:
Why Does 1 Samuel 1 Say Twice that THE LORD Had Shut Up Hannah’s Womb?
Condition: Infertility