Samuel, the son of Elkanah, and his wife Hannah, was a prophet and the last of Israel's Judges. Samuel grew up under Eli, who was the priest at Shiloh. He served a variety of roles in Israel. He was a prophet, a judge and a military leader. He was widely recognized throughout the country (1 Samuel 3:20). His home was in Ramah, were he headed groups of prophets.
At this time in Israel's history, about 3000 years ago, the nation was ruled by judges who settled disputes, not kings. But the people demanded to have a king, like other nations. Samuel was opposed to having a king rule over Israel because he interpreted that as an act of apostasy and a rejection of the Kingship of God. God told Samuel to anoint Saul, son of Kish, as king, and so the people got what they wanted.
However, in time, the relationship between Saul and Samuel deteriorated and Saul took over certain functions that had belonged to a priest, not a king. In addition, Saul disobeyed God after the battle with the Amalekites (1 Samuel 15:1-23). God had Samuel anoint young David to be the next king.
King Saul grew jealous of David. David fled from Saul and was given refuge by Samuel in his home in Ramah. David eventually succeeded Saul as king, but Samuel did not live long enough to see that. The story of Samuel is found in the book named 1 Samuel, chapters 1-25.
The Bible's book of 1 Samuel and the book of 2 Samuel are named after Samuel, and contain many details about his life. Some Bibles combine 1 Samuel and 2 Samuel into a singular book called Samuel.