There are words that don't follow the two rules of pronunciation you just learned. That's when you use an accent mark.
An accent tells you WHERE to place the emphasis in a word. For example, without an accent, this word would be aGUIla according to the rules of pronunciation. Placing the accent mark above the 'a' makes it águila which is the correct pronunciation in Spanish.
So, if a word does NOT follow the basic rules of pronunciation, then you must include an accent mark to indicate where the stress is placed.
Let's look at a couple of examples: 'fácil' means easy. Now according to the rules, since it does NOT end with a vowel or 'n' or 's', the emphasis should be on the LAST syllable. But the word is FAcil, not faCIL. That means we need an accent mark above the 'a' to move the stress.
Lápiz means pencil. Does it end with a vowel, 'n' or 's'? No it doesn't, so the emphasis again belongs on the LAST syllable. But the word is LApiz, not laPIZ. So we place an accent mark above the 'a'.
Inglés means English. Does it end with a vowel, 'n' or 's'? Yes it does, so the emphasis should be on the second-to-last syllable. But the word correctly pronounced is 'ingLES', NOT 'INGles'. So we need an accent mark above the 'e' to move the stress.