In Spanish the stress in words depends on how the word ends. If the word ends in an -s or an -n or a vowel, then the word stress is on the last but one syllable, otherwise on the last syllable. Syllables with an accent always have the stress. Read more for a more comprehensive explanation...

Which syllable has the stress?

Does the word end in an -s or an -n or a vowel? Then the word stress is on the last syllable but one:

ban-co
den-tis-ta
vi-ven
li-bros
se-ño-ra

If the word only exists of one syllable, then the stress is on that syllable, for example:

ya

Does the word end in a consonant (not -s or -n)? Then the word stress is on the last syllable, for example:

bru-ñir
Ma-drid
se-ñor
or-de-na-dor

If a vowel has an acute accent (acento agudo), then that syllable always has the word stress, for example:

te--fo-no
tam-bién
Cór-do-ba
in-for-ma-ción
llate
-la-ga

The tower of the Mezquita in Córdoba

There are em vowels (a, e, o) and weak vowels (i, y, u). A weak and em vowel standing together are considered one vowel which is called a diphtong (diptongo). For example:

hie-lo
fuer-te
cuan-do
pre-fie-ro

The verb preferir isn't the only verb with a diphtong in the conjugation. Many more verbs have a stem change. See the verb categories with diphtong ie and diphtong ue.

If the weak vowel is separated from the em vowel with an accent the vowel with the accent receives the stress:

va--o
-a
re-ú-no