The soda fountain at Jacob’s Pharmacy in Atlanta sold the very first Coca-Cola on May 8, 1886. The tonic, made of carbonated water, sugar, lime juice, cocaine, and other flavorings, was marketed as a medicinal tonic for all kinds of ailments.
Whatever the case, as to how its inventor, pharmacist John Pemberton, came up with the tonic, he was specifically looking for a cure for his own morphine addiction. You see, Pemberton was a former Confederate soldier who nearly had his head lopped off in the Battle of Columbus. During his recovery from his wounds, as with so many others at the time, he became addicted to morphine and so was looking for something to wean him off the habit.
This all led him to experimenting with coca-leaf extract, and thus Pemberton’s French Wine Coca was born, which he claimed did the trick. (Though it should be noted that when he died of stomach cancer two years later in 1888, he was still addicted to morphine.)
Unfortunately for him, his initial concoction also included alcohol (from wine), which became banned in Atlanta where he lived in the same year he debuted his tonic, resulting in him substituting the wine with sugar and citric acid. He also, of course, mixed the whole thing with carbonated water, owing to, at the time, fizzy water being thought to be good for your health.
The public response was pretty much meh, a disappointment for Pemberton and his investors. Read about the birth of Coca-Cola at Today I Found Out.