It's something I need to tell myself every day. Whenever I compare myself to someone else (or my baby to someone else's baby, or our home to someone else's home, etc.), I inevitably feel worse for it--even if I find myself on the (supposedly) better end of the comparison. Engaging in comparison will never make you feel better.
I've frequently heard people say that we shouldn't compare ourselves to others because we're probably comparing our weaknesses to their strengths, so it's not a fair assessment. While that may be true, that's not even the point! Comparison itself is what makes us unhappy, not the outcome of the comparison. Whether you are judging yourself to be better/smarter/prettier OR worse/dumber/uglier than someone else, the thought won't bring you real happiness.
I think it's part of human nature to compare ourselves to others, just like it can be in our nature to be rude instead of kind or angry instead of calm. So I always have to keep this idea in my mind: that comparison steals away my joy. And when I remember that, it's much easier to find joy in my own life and to be genuinely happy for other people as they find joy too.