One of the best practical tools of positive psychology is the gratitude notebook. In it you write, say, three things a day that you are grateful for. This helps you feel grateful in general, as a daily attitude, and cuts down on complaining and self-pity.
Gretchen Rubin, in her Happiness Project, found that she was more grateful if she compared down than if she compared up. That is, if she started thinking "I'm grateful I'm not ..." rather than "I wish I were ...," she ended up more grateful.
Social closure works like that, too, but in a negative way. Social closure is an idea developed by Max Weber to explain how status differences get turned into hard divisions between groups. The higher status group picks some small and mostly arbitrary difference between itself and the group immediately below, and tries to close ranks on the basis of that distinction. Educational credentials are the most important tools for status difference today, but practically any difference can be pressed into this service. And the group below, facing exclusion, resists being excluded. But they, in turn, tend to close against the group below them, engendering the same kind of resistance, and so on to the bottom of the social structure.
We can feel grateful that we do not have the problems of those worse off than us, without thereby wishing to exclude them from our society.
The fruit of social closure is a status ladder. The fruit of gratitude is compassion.