It is all about the syllable with the most force. I'll assume you know how to separate the syllables, but if you don't feel free to message me.
Syllable numbers:
1-2-3-4
Agudas: The last syllable has the most force. You add the "atilde" if the syllable finishes in N,S, or a vocal. Example: avión, mamá, señor.
Llanas: The 3rd syllable has the most force. You add the "Atilde" if the syllable doesn't end in n,a, or a vocal. Example: lapiz, mesa.
Esdrujúlas: The 2nd syllable has the most force. You always add the "atilde". Example: química, analítica.
Sobreesdrújulas: The 1st syllable has the most force. You always add the "atilde".
To really learn them, I recommend you do atilde exercises and have someone who really knows Spanish correct them to you. :) Hope it helps!