A friend gets good news and you wish that life for yourself too: that is 羡慕. It can be warm and generous—我好羡慕你—with no wish for the other person to lose anything.
嫉妒 is the sharper word. It names resentment toward someone because they have an advantage, success, or attention you lack. The deciding question is simple: are you admiring what they have, or are you bothered that they have it? 羡慕 lets you share the happiness; 嫉妒 puts friction between the two people.
