Hannah was unable to have a child. We don't have a reason given but it says the LORD had closed her womb. This would be a major heartbreak for her. Not only did she not get to be a mother as she desired, but the culture of that day would look down on her and maybe even consider that she must have done something wrong for God not to give her a child. This is compounded by the fact that her husband has another wife and is a father. (Having multiple wives was never promoted or endorsed by God. It is mentioned in Scripture because it was happening, but not one of those stories showed it was a good thing). Her husband seems to really love her, but doesn't necessarily know what to say. He basically implies she should simply be happy because she has him as a husband. A husband she has to share with another woman who is her rival. He did provide more for her as a way of showing comfort to her. However, it is quite possible that her husband married a second woman because Hannah could not have kids. That must have been hard for her to deal with.
Hannah brings her heart to God in prayer and asks for a son. She promises to devote the child to God. When we are struggling we can either turn to God for help or we can blame God and turn from Him. I don't know of any problem that got better because someone turned away from God. I have heard of many stories of God getting people through problems because they turned to Him.
Where do you go when you are facing troubles in life?