Sting was a well-forged blade made in Gondolin in the First Age, named by the Hobbit Bilbo Baggins. It shone with a blue light when orcs approached.

“It shone pale and dim before his eyes……..It was rather splendid to be wearing a blade made in Gondolin for the goblin- wars of which so many songs had sung; and he also and also he had noticed that such weapons made a great impression on goblins that came upon them suddenly”
(The Hobbit)

Bilbo found it in a troll cave while on expedition with Thorin and Company after the three trolls had been tricked and turned to stone.

“..Bilbo took a knife in a leather sheath. It would have made only a tiny pocket- knife for a troll, but it was as good as a short sword for a hobbit .”
(The Hobbit)

It was also in this cave that Gandalf found Glamdring and Thorin Oakensheild found Orcrist. Bilbo named it after he had slain a giant spider in Mirkwood, this was his first kill and made him feel strong and brave, despite his empty stomach.

“Somehow the killing of the giant spider, all alone by himself in the dark without the help of the wizard or the dwarves or of anyone else, made a big difference to Mr. Baggins. He felt a different person, and much fiercer and bolder….”
(The Hobbit)

After the expiditon with Thorin and Company, many years later Bilbo gave Sting and a coat of mithril to Frodo in Rivendell, before he set out on his quest with the fellowship. He used it all along his quest, in Moria he stuck the Cave troll on the foot so it fled screaming. Later in Mordor, in the tower of Cirith Ungol, Frodo gave Sting to Sam, after Sam had seriously wounded Shelob, ultimately leading to her death.