There was a certain man of Ramathaim-zophim of the hill country of Ephraim whose name was Elkanah the son of Jeroham, son of Elihu, son of Tohu, son of Zuph, an Ephrathite. He had two wives. The name of the one was Hannah, and the name of the other, Peninnah. And Peninnah had children, but Hannah had no children. (1 Samuel 1:1,2)
Hannah desperately wanted a son and promised God that if he gave her a son she would give him back to God to serve him.
And she vowed a vow and said, “O LORD of hosts, if you will indeed look on the affliction of your servant and remember me and not forget your servant, but will give to your servant a son, then I will give him to the LORD all the days of his life, and no razor shall touch his head.” (1 Samuel 1:11)
God answered her prayer. God gave her a son and she named him Samuel. When he was old enough she brought him to the house of God and gave him to Eli the priest.
And when she had weaned him, she took him up with her, along with a three-year-old bull, an ephah of flour, and a skin of wine, and she brought him to the house of the Lord at Shiloh. And the child was young.Then they slaughtered the bull, and they brought the child to Eli. (1 Samuel 1:24,25)
Jeremiah prophesied during the final years of Judah’s independence and lived through its final conquest by Babylon. He suffered many hardships, one of which was being denied the pleasures of having a family.
The word of the LORD came to me: “You shall not take a wife, nor shall you have sons or daughters in this place. For thus says the LORD concerning the sons and daughters who are born in this place, and concerning the mothers who bore them and the fathers who fathered them in this land: They shall die of deadly diseases. They shall not be lamented, nor shall they be buried. They shall be as dung on the surface of the ground. They shall perish by the sword and by famine, and their dead bodies shall be food for the birds of the air and for the beasts of the earth.”
The things that happened to him would have made it hard for him to fulfill his family responsibilities. His preaching was so unpopular that he sometimes spent time in prison or in hiding from the authorities and after the Babylonian victory he was forced to accompany some people who fled to Egypt for refuge. But even if the circumstance of his life had been different he would have been childless because of a curse placed on one of his ancestors.