How can I help people

I need help consoling people I feel useless whenever one of my friends gets upset and I don't know how to act.