Plenty of books have been written about happiness and why some people have it, and some don't. You could spend the rest of your life reading these and not get to all of them. Good thing we here at This Man I Am are committed to keeping things simple and pragmatic. You're a busy man, after all.
Let's start with calling negative people what they are, unhappy. Nobody that is living a happy and full-filling life has a negative attitude. It just doesn't happen. The happiest people I know love and accept themselves warts and all. So, here's the not-so-secret secret:
Happiness is an inside job.
Think about it like this; unhappy people are always in need of:
Validation, because they are unable to self-validate
Acceptance, because they are unable to accept themselves
Exoneration, because they are unable to take ownership of their lives
Here's what this looks like in practice:
Your co-worker comes in on Monday complaining about how his 'bitch-wife' busted his balls all weekend.
He's looking for you to validate him by saying, 'Wow, what a bitch'.
He's looking for you to accept him by complaining about your partner in a similar fashion.
He's looking for you to absolve him of his responsibility by saying, 'She shouldn't treat you like that.'
Don't fall for it. Instead, keep these five things in mind:
Never take it personally. The overwhelming majority of what people do or say is not about you. When others are unhappy, they often project their feelings onto others.
Don't stoop to their level. Try to avoid getting dragged into someone's narrative or onto their bandwagon. Complaining never solves anything.
Don't engage in gossip; it's never helpful. Unhappy people LOVE gossip because it distracts them from their insecurities. Plus, if someone is willing to gossip with you about someone else, you can bet they are willing to gossip about you with someone else.
Don't take ownership of their problems. If someone explicitly asks for your advice, it's okay to give it, but remember that these aren't your problems, so they aren't yours to solve. Empathize, but don't take ownership.
Never apologize for your confidence or your positivity. Your good attitude isn't hurting anyone beyond reminding them of their insecurities, which aren't your problem.
The person's attitude will improve because great attitudes are contagious.
The person will recognize that you aren't going to meet any of the above needs, and they'll take their pity-party to someone else.
Either way, you and your stylish good attitude win.