The helpful thing that does not help
A friend tells you about a rough week. You jump in with three fixes. They go quiet, and you wonder what you did wrong.
Often nothing was wrong with the fixes. They just wanted someone to listen first. Sometimes it is the other way round, and they do want ideas.
Ask, then follow their answer
Try this: "Do you want ideas, or do you just want me here for this?" It takes five seconds and works over text too.
If they say company, listen, say "that sounds really annoying" and leave the fixing for another day. If they say ideas, go ahead. You will be a lot more welcome.
Make it your own
Use whatever wording sounds like you: "Fix-it mode or listening mode?" works as well. Pick the words that feel normal in your friendship.
Do not worry if they say "I don't know". That is fine. You can listen first and offer one idea a bit later if it still seems useful.
