We already know about the classification of Spanish words, according to the syllable with stress. (See article Spanish Accents - Words' Classification ). So it is time to learn the rules to correctly write the orthographic accent in Spanish.
Palabras (Words) agudas:
These words must be written with an accent whenever they end in vowel, -n or -s.
(When we pronounce these words, we pronounce the last syllable with more emphasys and, as these last syllables end in "n", "s", "a" (vowel), we need to write the accent.)
Palabras (Words) llanas:
These words must be written with an accent if they do not end in vowel, -n or -s.
Palabras (Words) esdrújulas:
These words always need an accent. So whenever the word has the stress on its third syllable (if we start counting syllables from the end of the word), we'll write the accent.
These are the basic rules for Spanish accents. We'll learn soon more uses of accents, in different cases.