Whenever you want to give advice to someone, please don't do it halfheartedly. Instead you'll do these 3 things:
Listen to their problems, absorb their words and the pain behind it after that;
Put yourself into their shoes. Don't be such a hypocrite. Don't let them feel that their problems aren't as big as you're facing right now. Don't belittle them because their being too emotional or overreacting. Instead put yourself into their situation, feel their pain even just for a little bit, enough for you to understand what they are trying to say – that's what you called empathy.
3. Lastly, EMBRACE THEM WITH TRUE AND PURE WORDS
I don't want to say "good words" because it's already overrated and not so real to tell. Instead, let's be straight forward.
Tell them you understand them and why are they so sad. After that, tell them your own opinion. You can be rational and reasonable as much as you want but don't be so one-sided. We, people had the ability to understand each other. Let's use them in a good way. God gave us knowledge not just to use it for basic purposes but also to understand other human's mind and emotions. Be open-minded. We should always ready to open our minds in understanding other people.
To give an advice isn't really easy especially when you also need that for yourself too. But remember giving kindness to all people doesn't cost anything. You can be kind to everyone as much as you can but don't let your guard down also.