Avoid the company of a fool for he will harm you while trying to benefit you. Avoid the company of a liar for he will bring you near what is undesirable and remove you from what is desirable. Avoid the company of a miser for he would withhold from you what you stand in need of. Avoid the company of a libertine for he will sell you for a trifle.
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari