No matter how excellent a workplace may function, sometimes the demands of the job can make the most pleasant of workers express negativity when feeling overwhelmed.
How do you keep your attitude from being affected by a person complaining?
Personally, I acknowledge the obstacle and validate the person's strengths and positive aspects, and share ways in which I have had success in the situation at hand, and I lend a helping hand whenever possible. I heard on a radio talk show years ago that people only really require about 2 minutes of your time to listen to them. I have 2 minutes. It works for me most of the time.