Praise be to Allah.
The saying referred to is the words of ‘Abdullah ibn Mas‘ood (may Allah be pleased with him): “Whoever wants to follow a path, let him follow the path of one who has died, for the living are not safe from fitnah. I mean the Companions of Muhammad (blessings and peace of Allah be upon him). They were the best of this ummah: the purest in heart, the deepest in knowledge and the most straightforward. Allah chose them to accompany His Prophet and establish His religion, so recognise their status and follow in their footsteps and adhere as much as you can to their example of conduct and attitude, for they followed true guidance.”
This report was narrated by Ibn ‘Abd al-Barr in Jaami‘ Bayaan al-‘Ilm wa Fadluhu, 2/947, no. 1810. There is some weakness in its isnaad, but it is a well-known report that appears in many of the books of Ahl as-Sunnah, and its meaning is sound and approved of by them.
What is meant by it is that whoever wants to follow a path to his Lord, he should not come up with a path by himself or imitate with regard to matters of religion one among the living who is like him, because he is still alive and he does not know what kind of end Allah will cause him to have. Thus he may find himself following a man in his religious affairs who, even though today he may he following guidance and the Sunnah, may end up following something other than that. The only one who is safe in that regard is one who follows, on his path to his Lord, the way of the righteous early generations of this ummah: the Companions of the Prophet (blessings and peace of Allah be upon them), those who have died and there is no longer any fear that they may fall into fitnah.
Imam Nasr ibn Ibraaheem al-Maqdisi (may Allah have mercy on him) said, after narrating this report from Ibn Mas‘ood and Ibn ‘Umar (may Allah be pleased with them):
This is what Ibn Mas‘ood and ‘Abdullah ibn ‘Umar (may Allah be pleased with them) said. Allah (may He be exalted) spoke of them (the Sahaabah) in more than one place and proved that they are above any suspicion. The Messenger (blessings and peace of Allah be upon him) also spoke of them and instructed us to refer to their example, learn from it and act upon what they said. Even though he knew about what would happen in our time of innovations and conflicting whims and desires, he did not tell us to adhere to anything other than the Book of Allah, the Sunnah of His Prophet and the way of his Companions, may Allah be pleased with them all. And he forbade us to follow anything that has nothing to do that or to follow anyone who goes in a way other than the way followed by his Companions.
So we must follow his commands and instructions and heed his prohibitions.
This was the way of the scholars and imams in earlier generations, until the time when innovations became widespread.
End quote from al-Hujjah ‘ala Taarik al-Mahajjah by Nasr al-Maqdisi, 1/159
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
It is very well known to anyone who ponders the Qur’aan and Sunnah and the consensus of all groups among Ahl as-Sunnah wa’l-Jamaa‘ah that the best generations of this ummah – in deeds, words, beliefs and all other virtues – is the first generation, then those who came after them, then those who came after them, as is proven in more than one report; they are superior to the later generations in every virtue, be it knowledge, deeds, faith, reason, religious commitment, eloquence or worship. Their view of any problem is more deserving of being followed. This cannot be denied except by the one who would refuse to accept that which is well known in the religion of Islam and whom Allah sends astray despite his knowledge, as ‘Abdullah ibn Mas‘ood (may Allah be pleased with him) said.
End quote from Majmoo‘ al-Fataawa, 4/157
Imam ash-Shaatibi (may Allah have mercy on him) said:
The reports that confirm this idea are many; all of them indicate that one should take them as an example and follow their way in all situations. It is the way of salvation, as was pointed out in the hadeeth that speaks of the division of the ummah, in which the Prophet (blessings and peace of Allah be upon him) said: “… what I and my companions are following.” (i.e., the group that follows this path is the saved group.)
End quote from al-I‘tisaam, 3/307. See also Mirqaat al-Mafaateeh by Mullah ‘Ali al-Qaari, 1/374
And Allah knows best.