Still, even in real life, giving unsolicited advice never works in my opinion. It's basically as useless as complaining about something and thinking it will magically change without doing anything different.
Note I have seen the following be useful:
1. Is the person really just saying "I want a hug" with their complaining? If so, and you care about this person, just give them a hug.
2. Depending on your relationship with the person, and if you can accept any blowback, it's also fine to say "I'm sorry, I don't want to be a receptacle for your complaining today."
3. Ask the person if they want help fixing the problem.
Note I have seen the following be useful:
1. Is the person really just saying "I want a hug" with their complaining? If so, and you care about this person, just give them a hug.
2. Depending on your relationship with the person, and if you can accept any blowback, it's also fine to say "I'm sorry, I don't want to be a receptacle for your complaining today."
3. Ask the person if they want help fixing the problem.