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."
عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ؓ عَنِ النَّبِيِّ ﷺ قَالَ إِذَا رَأَيْتُمُ الْجَنَازَةَ فَقُومُوا فَمَنْ تَبِعَهَا فَلاَ يَقْعُدْ حَتَّى تُوضَعَ