If a person sees himself digging the grave of a dead person who is known to him it means he will follow in his footsteps in worldly as well as religious matters.
If he is unknown to him, he will pursue a matter wherein he will not succeed.
Islamic Dream Interpretation
by Ibn-i Sirin
What Does Digging The Grave Of A Dead Person Mean In Dream?