As mentioned above, there were lots of people angry over the annexation of Bosnia Herzegovina by Austria Hungary, especially the Bosnians, the Herzegovinians, and the Serbian government, although not all for the same reasons.
In June of 1914, in his capacities as Inspector General of the army, Franz Ferdinand and his wife Sophie traveled to Sarajevo to, well, do an inspection of the troops there. On their way back to city hall, there was going to be another ceremony of some kind (it must've be exhausting to be an heir apparent to an empire).
That's when a member of the Bosnian Youth, who knew about Ferdinand's visit, hurled a bomb as the motorcade passed.
The bomb missed its targets but injured some of the officers in the motorcade. Despite the close call, Franz Ferdinand went through with the event at the Sarajevo city hall. He was advised to leave immediately, but first he insisted on visiting the injured officers in the hospital.
One Wrong Turn (Don't Blame the Driver)
The trip was by now getting pretty chaotic, as could be expected. It was decided that the motorcade would take a short, straight drive to the hospital. Unfortunately, the finer points of this new route were not understood by everybody in the party, and at a certain point, a wrong turn was made.
Realizing his mistake (probably because the Governor of Bosnia, who was riding with Franz Ferdinand and his wife, and who actually knew the right way, started shouting), the driver put the car in reverse, but upon trying to back up, stalled it.
Two Lives Lost
This gave Gavrilo Princip, who happened to be on the street where the Archduke's car had just stalled, the opportunity he needed. He stepped up and shot both Franz Ferdinand and Sophie at point blank range. (Princip later claimed he had been trying to kill the governor, not Sophie.)
Sophie lost consciousness almost immediately and died shortly thereafter. Franz Ferdinand's life was over in a matter of minutes, as his bullet wound to the jugular vein meant he rapidly lost a critical amount of blood.