Buraidah (May Allah be pleased with him) reported:
Messenger of Allah (ﷺ) said, "(In the past) I forbade you from visiting graves, but visit them now."In another narration Messenger of Allah (ﷺ) said, "Whoever wants to visit a graveyard, let him do so, because it reminds us of the Hereafter."[Muslim]. (RU)
App reference (RU): Book 1, Hadith 582 (RU)
Arabic/English book reference (RU): Book 1, Hadith 581 (RU)