Generally, the pronunciation of the letter “X” in Spanish -particularly when it’s found in between two vowels- is very similar to that of its English counterpart (“ks” sound), save for the fact that it is rather softer (less plosive).
When preceding another consonant -as in “exponer” (expose), “extradición” (extradition), “exquisito” (exquisite), and such-, it mostly follows the latter rule, although in some regions (of Spain, most notably) it is pronounced as a simple “s”.
The “s” sound, on the other hand, is more commonly given when the “X” is located at the start of a word, as is the case of “xilofonista” (xylophonist) or “xenófobo” (xenophobe), for example.
It is worth mentioning that the letter “X” receives completely different pronunciations in some areas: in Mexico, for instance, where it is sometimes pronounced as an English “H” (as a matter of fact, the country’s name in itself should sound more like “Me·hi·ko” than the most often heard “Me·xi·co”).
All the same, there are certain words in Catalan, Basque, and some southern Mexican/central American dialects in which the “X” denotes an English “sh” sound, one of the most remarkable illustrations of this phenomenon being the name of the Guatemalan city of “Xela”, which is pronounced as the English “Shai·la”, instead of “Sai·la” or even “Zai·la”.