As others have said, an earthquake alone is localised and cannot wipe out humanity on a global scale.
There is a related phenomenon that could: volcanic winter. In 1816 a volcanic eruption in Indonesia caused failed harvest in Europe and North America, known as the year without a summer. Multiply that by 10 over a slightly longer period and you have global starvation.
As for unforeseen consequences, it is known that volcanic activity is higher in interglacial periods due to less pressure on the earth's crust. So paradoxically, global warming could be the trigger for a massive volcanic event. Another possible consequence of deglaciation caused by global warming is a sudden release of large quantities of freshwater into the sea. This has happened in the past in the North Atlantic - it cut off the gulf stream circulation in the Atlantic and caused cooling in western Europe
The biggest direct consequence of an earthquake would be a tsunami, but the height of these is limited to a few metres by the max vertical displacement of land that an earthquake achieve. A related phenomenon is a megatsunami which is caused by sudden displacement of a large amount of material into water. This may or may not be triggered by an earthquake. The Lituya Bay megatsunami washed out trees to a height of 524 metres, but that was local. Landslides at volcanic islands can create megatsunamis. It is said that a megatsunami in the Canary Islands could cause damage to the East coast of the United States, though its height would be reduced to that of a regular tsunami as it crossed the atlantic and spread out from its epicentre. I suppose such a landslide at a volcanic island could trigger or be caused by an eruption.
An exceptionally unfortunate chain reaction of the above events could give the result you are looking for.
Note that dam building can cause geological instabity, or exacerbate the consequences of a landslide or earthquake. Vajont dam (mentioned in the megatsunami link) is an example. A much worse dam failure (caused by bad weather and poor engineering) occured at Banqiao and killed 250,000 people, considered the worst technological disaster of all time.