Egy példa:
A: Segítek az embereknek.
B: Kiknek segítesz? Ezeknek az embereknek (itt)?
A: Nem, nem ezeknek segítek, hanem azoknak. Azoknak az embereknek segítek (ott).
ezek and azok are in English these and those, im German diese und jene. In English these and those stay the same but in German, such as in Hungarian they change when they are in Dativ (indirekt object). For example: Ich helfe dieseN/jeneN Leuten. In German it gets the ending "N", in Hungarian it gets the ending "nak/nek" when they are in "dativ".
Other examples with other verbs are: adok ezeknek a gyerekeknek csokit/ mutatok azoknak a vendégeknek valamit/mondok ezeknek a tanulóknak egy viccet/mesélek azoknak a gyerekeknek egy mesét stb!
So you use it after verbs that require the case "dativ", the ending "nak/nek" - like: ad, mutat, mesél, mond, ajándékoz, segít stb!
I hope it helps!