Sahih Muslim, Book 11, Hadith 126 (Muslim 2226)

Abu Marthad al-Ghanawi reported Allah's Messenger (ﷺ) as saying:

Do not sit on the graves and do not pray facing towards them.