I came across this page via lifehacker. Wow. A well written piece on something we all experience: the habit of complaining. Some fall in to this trap to a greater extent than others, but we all fall into it, even if occasionally-- my wife would love to offer more insight into how often I've been entangled in its snares. But, I shall defer to her.
There's something that rings so true in this article about working on controlling your negative thoughts. Accept they are there, but they are not you. You have a choice.