there is nothing in the lawful visitation of graves that makes the living dependent on the dead, nor does it involve asking the deceased for anything or seeking his intercession. Rather, the benefit flows from the living to the dead—such as praying over him. Allah shows mercy to the deceased through the supplication and good deeds of the living, and He rewards the living for their actions.
It is soundly reported in an authentic hadith that the Prophet—may Allah bless him and grant him peace—said:
“When the son of Adam dies, his deeds come to an end except for three: a continuous charity, knowledge from which people still benefit, or a righteous child who prays for him.”
Section
The ruling on someone who goes to the grave of a prophet or a righteous person and asks him for help
As for the one who comes to the grave of a prophet or a saint—or to what he believes is the grave of a prophet or a righteous man when in fact it is not—