Apparently, coffee was drunk by Yemeni Sufi sects around the 15th century to wake them up for nighttime prayers.
So it was a drink to keep them awake at night.
Yemen is a coffee-producing country, known for its mocha.
In the 16th century, coffee was introduced from the Middle East to Europe via the Ottoman Empire.
Then, due to the colonial policies of the Netherlands, France, and Britain, its cultivation spread to Indonesia, the Caribbean, Central and South America, and Africa. Coffee houses were established in London and Vienna in the 17th century.