Sitting in the company of poor people helps us to get onto right track and enables us to ponder on blessings we have, seeing people who are deprived of basic accessorizes of life, not only softens our hearts, but makes us humble, and thankful to our creator. That is why it has been told to us to always see people below us, and not to fall into unremitting worldly race, because it never ends.
A grateful person, when stuck in tough or hard situations, is patient and prays. He looks for the hidden blessings in every situation, and is thankful that the situation is not worse. An ungrateful person has victim-hood mentality, and may even pray for his death or commit suicide when the going gets tough.