Listen to the girl. This is the first thing to do. Do not interrupt her, do not fret, do not offer seemingly perfect solutions to the problem, until you hear the whole story until the end. Sometimes the woman becomes easier, when she will speak, cry out loud say the words that tormented her. If a girl does not mind, you can maintain tactile contact: Pat on the head, to hold hands, to hug. This should be done easily and unobtrusively, simply indicating its presence and readiness to support.
Ask how you can help, tell me about the specific steps which can solve at least some of the difficulties. Another option is just to offer my help in case it is needed in the future. For example, you can say: "If you need anything, just contact me and I will do everything in my power to support you". It is important to let a girl know that you care about her problem and that you will not leave her alone with difficulties.
Mention the problem to find the words to comfort. If the girl is really upset because of the dismissal, explain that to find a new job is not as difficult as it seems, tell us some positive stories on this subject. If we are talking about parting with the man advise the woman to deal with them and distract, invite her for a walk or to a movie, select a pleasant pastime, which helps to distract from problems.
If we are talking about the death of a loved one, try to make the girl herself began to comfort others. Gently explain to her that others, too, faced with terrible loss, in need of her help and support. Shared sorrow becomes a little weaker and the understanding that others also need comfort, gives strength. Offer to help with funeral arrangements or other issues that inevitably arise in such cases. Taking the girl mind you will be able to comfort her a little.