Abu Marthad al-Ghanawi reported Allah's Messenger ﷺ as saying: Do not pray facing towards the graves, and do not sit on them.
The Prophet Muhammad taught us that it is important to remember those who have passed away but also maintain respect for their resting place by avoiding activities such as praying or sitting near the grave site. We should instead focus our prayers directly towards Allah in order to receive His blessings and mercy upon us all. Additionally, this hadith serves as a reminder for us to be mindful of how we interact with others around us; even if someone has passed away, they still deserve respect from those living around them.