The Prophet ﷺ said: The key of prayer is purification; takbir (saying "Allah is most great") makes (all acts which break prayer) unlawful and taslim (uttering the salutation) makes (all such acts) lawful.
قَالَ رَسُولُ اللَّهِ ﷺ مِفْتَاحُ الصَّلاَةِ الطُّهُورُ وَتَحْرِيمُهَا التَّكْبِيرُ وَتَحْلِيلُهَا التَّسْلِيمُ