the tone, facial expression, and general attitude to the 'listening' matters hugely too.
I have one friend who is good at it - she can listen, and even offer solutions occasionally, but makes me feel heard and cared for. She just naturally has an ability to get people to worry less about things by making them feel understood. She doesn't particularly enjoy this role I don't think; she is an academic and doesn't want to end up pigeon-holed into a pastoral tutor role because she's one of a small number of females, but she is actually very good at it!
Another will always end up saying things like 'don't worry about it' or 'there's nothing you can do', and she will always sound dismissive, even though I don't think she means to. She cares a lot about people, but just doesn't really understand what they need and doesn't know how to express that empathy very well with them. Even if she ended up saying the same words at some point as the first friend, her manner of doing it just makes it sound dismissive and unhelpful, and I leave frustrated.
A lot of it involves taking the cues from the person, as people do want different things, and never assuming that you know what they need better than they do. Another person I know (not exactly a friend but someone who I have to talk to frequently for various reasons) always assumes that he knows what would make someone better and what they should do, and he can't really accept that it is often not what they need. He dismissed people (behind their back) as being attention-seeking, or over-thinking, or worrying too much, or needing to be pushed into doing something, and assumes that his way of not pandering to them is what will help. Even when I can see how irritating some of the people he is talking about might be, his solution of not pandering is actually making things any better. One person who complains a lot about things ends up complaining more, I think, because she doesn't feel heard or believed - so she ends up making things sound worse, just to get some sympathy.
So it's such an individual thing, and depends very much on the listener adapting their behaviour differently, or pulling out of the situation if they don't think they can offer what is needed. I'm much more of a person who just wants to be heard and for someone to show that I'm cared for, as I'm not very good at getting those needs met in other ways (which I am aware of, and am trying to work on). But for me, I don't want to be challenged, dismissed, told not to worry, told it's nothing, told what to do, etc. I want sympathy and a demonstration that I matter to the person.