The Messenger of Allah (Allah bless him and give him peace) said: “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.” [Muslim, Tirmidhi
Giving money to the poor is an emblem of Islam and a sunna of the Prophet Muhammad (Allah bless him and give him peace). He was never asked for anything, except that he
gave it, and he would give without fearing poverty. People said that he was more generous than the “sent wind” that brings the rain clouds. Every wealthy adult Muslim must give 2.5% of his or her wealth in charity every year. Allah says: "O you who believe! Spend out of what We have given you" (2:254). This is the least charity a Muslim must give every year. Charity should be taken from the best of your wealth, and from what is dearest to you. Giving in charity is like giving to Allah Most High, and so only give Him what is good. Allah says: "O believers! Give something of your pure earnings and of what We produce from the earth for you; and intend not to give especially vile of it, whereas if you get of it, you will not accept unless you close your eyes in it. And know that Allah is free of all wants, Praiseworthy." (Quran 2:267). If the money you donate has been acquired dishonestly, it cannot be considered a good deed.