Sahih al-Bukhari, Book 23, Hadith 68 (Bukhari 1268)

Narrated Abu Sa`id Al-Khudri:

The Prophet (ﷺ) said, "When you see a funeral procession, you should stand up, and whoever accompanies it should not sit till the coffin is put down."