When the s comes after a vowel, then it’s pronounced as z (also, count ar, er, if, or, and ur as vowel sounds). Also, it’s pronounced as “z” when it comes after a voiced consonant, so “m,” “n,” “v,” and other ones like that. Honestly, one of the best ways to learn the difference is to listen to native speakers and see what they do, but here are some examples.
WORDS THAT END WITH VOWEL SOUNDS THAT MAKE THE S SOUND LIKE Z
bees, ways, cars, hours, oranges
WORDS THAT END WITH VOICED CONSONANT SOUNDS THAT MAKE THE S SOUND LIKE Z
pens, spoons, rams, loves, planes