"نَهَيتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا، فَإِنَّ لَكُمْ فِيهَا عِبْرَةً".
It is a Sunnah to visit graves as they remind one of death
The Messenger of Allah ﷺ as saying: I forbade you to visit graves, but you may now visit them, for in visiting them there is a reminder (of death).
قَالَ رَسُولُ اللَّهِ ﷺ نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا فَإِنَّ فِي زِيَارَتِهَا تَذْكِرَةً
[Machine] The Messenger of Allah ﷺ said: "I used to forbid you from visiting graves, but now visit them and do not say anything that would drive them away."
قَالَ رَسُولُ اللهِ ﷺ كُنْتُ نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا وَلَا تَقُولُوا هُجْرًا
The Messenger of Allah ﷺ as saying: I forbade you to visit graves, but you may now visit them, for in visiting them there is a reminder (of death). (Using translation from Abū Dāʾūd 3235)
قَالَ رَسُولُ اللَّهِ ﷺ «نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا فَإِنَّهَا تُذَكِّرُكُمُ الْمَوْتُ»
[Machine] The Messenger of Allah ﷺ said, "I have forbidden you from visiting graves, but now go and visit them, for there are lessons to be learned from them."
قَالَ رَسُولُ اللهِ ﷺ «نَهَيْتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا فَإِنَّ لَكُمْ فِيهَا عِبْرَةً»
"نَهَيتُكُمْ عَنْ زِيَارَةِ الْقُبُورِ فَزُورُوهَا، فَإنَّهَا تُذَكِّرُكُمُ الْمَوْتَ".