not sure if it's the same for everyone... and it may be different at different times...
sometimes, someone happier and luckier than you, is an inspiration... or can make you feel good without thinking.. ('Oh, if s/he could make it, I can make it too!!')
sometimes, one realizes one's luck when looking at people worse off too..
it may also be good to be around people on a similar level as you are.. to see how they are dealing with similar problems etc.
so, it's good to know many kinds of people, and be around them... or at least know their stories.. some can be inspirational, some can be 'warning signs' and teach you which mistakes not to make (hopefully) etc. You can learn from everyone...