The Spanish esperar — the common word meaning “hope, wait, expect” — comes from the Latin sperare for the same.
So it’s unsurprising that its opposite in Spanish, desperar, parallels exactly the English, despair. Ahhhh!
Less obvious is that the Latin sperare comes from the Proto-Indo-European root *spe, meaning “to thrive”, from which we also get the English, speed.
Speeding and hoping are indeed both forms of thriving!