Bilbo Baggins is the protagonist of The Hobbit by J.R.R. Tolkien, and he is a hobbit. That means he would much rather stay at home than go on an adventure.
“We are plain quiet folk, and I have no use for adventures. Nasty, disturbing, and uncomfortable things.”
Nevertheless, he rather suddenly finds himself in the midst of quite a grand adventure. Swords and weapons are not something he is too familiar with, but he is soon forced to learn how to use them.
In chapter two, Bilbo and the others are several weeks into their journey; it is raining and the travelers want to find shelter and a fire so they can have a warm, dry meal. They see some firelight in the distance, and Bilbo is sent to investigate. He discovers some trolls sitting around a fire and complaining that they have no "manflesh" to eat.
Bilbo gets caught but, fortunately for him, the trolls begin to fight over which of them is going to eat him. When the dwarves hear the ruckus they come to rescue Bilbo but they also get caught. Gandalf comes and saves the day, and in the morning, when the trolls have turned to stone, Gandalf and the others look for and find the trolls' cave. Inside they discover some food and some weapons. While several of the others take swords, Bilbo takes a knife--which is just the right size for a Hobbit sword.
Bilbo wears the sword "inside his breeches" so he can still ride with being encumbered by the sword which will later be named "Sting."