One of the first functional lighters was invented by a German chemist named Johann Wolfgang Döbereiner in 1823 (picture of it below). This lighter worked by passing flammable hydrogen gas, produced within the lighter by a chemical reaction, over a platinum metal catalyst which in turn caused it to ignite and give off a great amount of heat and light. Simple, right?
I mention functional lighter above, but the fact is, as with a lot of inventions, soldiers had their own way of lighting cigarettes using their flintlock pistols well before Johann's invention. The problem was that gun powder was a precious commodity and could determine a soldier's life or death, so they limited the use of these flintlocks when it came to lighting their smokes.
In 1826, a chemist from England by the name of John Walker, invented the match. It was actually by luck when he witnessed a stick that had some fuel on it and it burst into flames not on the entire stick, but only on the section with fuel. He then cut small sticks, dipped the tips in fuel, and added a form of sandpaper to the boxes he was packaging the matches in, so that the friction would ignite the match.
Now you know the rest of the story. 😉
Johann's cigarette lighter: