In Spanish, there are two key points to master pronunciation.
The five vowels a, e, i, o, u. Each vowel is pronounced as a single tone.
The word stress. Each word has only one stress point. Words ending in consonants get stressed at the last syllable. Words ending in a vowel (a, e, i, o, u ) or consonant n or s, get stressed at the second-last syllable. Words with a tilde are stressed at the syllable where the tilde is located. Tildes are stress marks on top of vowels in a particular syllable.