There is a big difference between a group gathering for therapy, and having someone engage you in 'conversation' where they're cornering you to complain about their ailment.
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.
You can always ask. Seriously! Some communications books literally recommend you ask whether they want support/connection/advice.
And you will rarely go wrong if you commiserate. So: Commiserate first, and then say "I have some ideas on what may help, ... " and what follows is context dependent.
If it's a chronic health issue that you have not dealt with: "but you probably know more about this than I do and probably don't want to hear yet another idea."
If it's a chronic health issue that you have dealt with: "and they solved a similar problem I had, but I'm not sure your situation is the same as mine."
Trust me - if they want to hear your solution, they will then ask.
If it's very generic advice that people commonly treat as a panacea (e.g. diet, exercise, supplements, meditation, mindfulness), better to commiserate and keep your advice to yourself.
Heh, I have to admit I chuckled at that one. To be honest, I felt somewhat similarly earlier in my life. In all seriousness, I highly recommend group therapy. You will discover that no matter how much you feel "compelled" to give advice in moments when people are looking for support and connection, that nobody, and I mean nobody, wants to hear it.