The Messenger of Allah ﷺ said, "Visit the graves, for they remind you of the Hereafter."
حدثنا أبو بكر بن أبي شيبة حدثنا محمد بن عبيد عن يزيد بن كيسان عن أبي حازم
قال رسول الله ﷺ زوروا القبور فإنها تذكركم الآخرة
Muslim reported it in the Book of Funerals, Chapter on the Prophet seeking permission from his Lord to visit his mother's grave, hadith no. 976b, on the authority of Abu Bakr bin Abu Shayba and others, in a longer form.