This open and non-judgmental attitude is not easy to have, because we all have biases that influence our interpretations and reactions, without us realising it. For example, we may not understand why our friend is having a hard time and react awkwardly.
For your listening to be beneficial, you must accept your friend's difficulties as they are, respecting their way of experiencing them, without judging. Be careful never to minimise their experience, their situation and their emotions.
Be careful with your verbal and non-verbal language, which could give the impression that you are not paying attention or that you are not interested in what your friend is telling you (for example, by being on your phone at the same time). To best help your friend, you should make yourself fully available to them for about ten minutes and listen without cutting them off.
Try to show empathy, i.e. your ability to understand and perceive the other person's emotions. This does not mean feeling distress in response to your friend's distress: it means perceiving their distress, giving them the space to express it and showing in your response that you have understood their emotional state. Here are some examples of how you can show empathy:
This sounds like a really difficult / painful situation for you
It can't be easy to be in this situation right now
I understand that you are struggling
I'm really sorry you're going through this
Simply listening with kindness and empathy to your friend in difficulty is an essential form of support.