We've all been there. Frustrating assignments, challenging co-workers, or even personal problems can lead to an outburst in the workplace. The question every perpetrator/victim asks in the aftermath: "Is it okay to lose it at work?" The obvious answer is, "No." However, given the stress involved in any job, the occasional tumble down a negative hallway is inevitable. The best solution is to calm down discreetly, and refocus your energy toward the goal at hand: getting back to work.
Assuming your current project wasn't the emotional catalyst; diving back in with determination is likely to take your mind off whatever initially irked you. Avoid the bothersome topic or person entirely, and boost your self worth by committing completely to what you do best: your job. At the end of the day, go home, and avoid thinking about the incident. The next day, your office outlook is sure to be slightly sunnier.
If work itself was the source of your anguish, take a break in a quiet location and find your emotional ground. Once you've recovered, try again. The emotional release of crying in your car, going for a walk to clear your head or having a quiet lunch could create the necessary change in perception to turn a source of anxiety into a benign task. If not, take a personal day, assuming that's possible.
Either way, the antidote to an unprofessional display is to convey the opposite at the next opportunity. If you insulted someone at a meeting, apologize gracefully, and hope for the best. If your boss upset you to the point of tears, recapture your personal power by exhibiting strength in future encounters. You can't stop someone from being rude or degrading, but you can choose to disregard their hurtful words. Remind yourself that you don't know the offender's entire day, and his criticisms may have nothing to do with you at all.
Always keep in mind, we're all human, and everyone has a bad day. Never degrade yourself for showing emotion; it's bound to happen. By taking necessary breaks and targeting your energy away from immediate causes of stress, you can limit the drama in your workplace to a reasonable minimum.