Perhaps she is dealing with a death in the family. Maybe she recently suffered a loss of another kind, like the dissolution of a job or friendship. Maybe she's just feeling down for no particular reason. Whatever the reason, as her boyfriend, you are in a unique position to comfort your girlfriend in her hour of need.
Be there. Your physical presence is paramount in your ability to provide comfort. While you can certainly provide comfort over the phone, email, video chat or in a hand-written letter, physical closeness will allow you to caress, hold and stroke her and be that shoulder for her to cry on, literally. If it's game night with your guy friends, consider canceling. Showing up shows her that she is a priority to you, which is comforting in and of itself. If being together in the same room is impossible, you are in a long-distance relationship or there is another barrier, make every attempt to be there for her emotionally if your physical presence is impossible.
Listen. Show compassion and concern as she tells you why she is feeling down. Turn off your phone, make eye contact, and don't speak until she is finished talking. Don't rush in to save her by telling her what she should do or how she should solve her problem. Likewise, don't attempt to solve her problem for her. As her boyfriend, your job is simply to be there for her and allow her to unburden herself to you. Or perhaps she just wants to cry or sit in silence with you. Take your cues from her and don't attempt to break the silence just to ease your own anxiety.
Ask her what she needs from you. It would likewise be unfair of her to expect you to automatically know how to comfort her in every situation, so don't put this pressure on yourself. Depending on the circumstances, she may say that she needs you to give her space, to help her brainstorm solutions or to simply hold her for awhile. She may ask you to distract her, do a favor for her or complete a practical task that feels comforting or alleviates tension in the moment.
Cheer her up. Once she has vented to you, suggest something you can both do together that could help to turn her mood around. Is there a game she loves to play? What is her favorite movie or her favorite meal? Indulge her in a spontaneous mini-date that was designed specifically with her in mind. Sometimes, a "Friends" marathon and a tub of Ben & Jerry's is all she needs to clear her head. If she decides that cheering up is not what she needs right away, accept this and allow her the space and time she needs to process her difficult emotions.