The Companions preserved the Sunnah first by memorisation and practice, and also by writing: ʿAbdullāh ibn ʿAmr wrote down what he heard with the Prophet's permission — the Prophet ﷺ pointed to his mouth and said, "Write, for by Him in whose Hand is my soul, nothing comes out of it but the truth" — and on the day Makkah was conquered the Prophet ﷺ ordered that his sermon be written out for Abū Shāh. Because he warned, "Whoever lies upon me deliberately, let him take his seat in the Fire," the ummah developed the isnād; Muhammad ibn Sīrīn said that people did not ask about chains until the fitnah occurred, after which they said, "Name us your men." Systematic collection was ordered by the caliph ʿUmar ibn ʿAbd al-ʿAzīz through scholars such as Ibn Shihāb al-Zuhrī, producing the muṣannafāt and then, in the third century, the Ṣaḥīḥayn of al-Bukhārī and Muslim and the four Sunan. Alongside these grew ʿilm al-rijāl and al-jarḥ wa'l-taʿdīl — biographical criticism of every narrator — which is why an authentic report can be distinguished today from a weak or fabricated one.
Q&A · Islamic History
How were the hadith collected and authenticated after the Prophet ﷺ died?
Evidence — the daleel
Sahih al-Bukhari 110 ṢaḥīḥSahih al-Bukhari 2434 ṢaḥīḥSunan Abi Dawud 3646Quran 53:3-4Sahih Muslim, Muqaddimah — statement of Muhammad ibn Sirin on the isnad
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.