The Prophet Muhammad (ﷺ) used to teach the people, “When the Imam recites, then listen attentively, and if he is sitting (in the prayer) then the first remembrance that anyone of you recites should be the Tashahhud.’” 
It’s this reason while we are sitting in the second and fourth rakat of Salah that we recite the tashadud.
In many other hadith narrations it was recorded that he used to teach Tashahhud just like as he would teach Surahs from the Quran. , 
This emphasized the importance placed on saying the tashahhdud. By reciting this supplication it is as if “you have surely sent the greetings to every good (pious) worshipper of Allah, whether he be in the Heaven or on the Earth.” 
Learning the Tashahhdud dua (also commonly known as Attahiyat) is a crucial step to perform salah.
Let’s jump in and learn this full dua and when to say.
Learn Tashahhud Dua in Arabic Text:
In Arabic this is written:
التَّحِيَّاتُ لِلَّهِ وَالصَّلَوَاتُ وَالطَّيِّبَاتُ السَّلاَمُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللَّهِ وَبَرَكَاتُهُ السَّلاَمُ عَلَيْنَا وَعَلَى عِبَادِ اللَّهِ الصَّالِحِينَ أَشْهَدُ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَرَسُولُهُ
Transliteration: At-tahiyyatu lillahi was-salawatu wat-tayyibat, as-salamu ‘alaika ayyuhan-Nabiyyu wa rahmatAllahi wa baraktuhu. As-salamu ‘alaina wa ‘ala ‘ibad illahis-salihin, ashahdu an la illaha ill-Allah wa ashhadu anna Muhammadan ‘abduhu wa rasuluhu
tashahhud dua english translation:
The meaning of the tashahhud in english is “All the compliments are for Allah and all the prayers and all the good things (are for Allah). Peace be on you, O Prophet, and Allah’s mercy and blessings (are on you). And peace be on us and on the good (pious) worshipers of Allah. I testify that none has the right to be worshipped but Allah and that Muhammad is His slave and Apostle.”
While saying wa ashhadu anna Muhammadan abduhu wa rasuluh it’s sunnah to raise the index or forefinger.  It was also mentioned that the tashahhud should be recited silently. 
Said During Sitting Position of Salah
The Tashahhud outside salah can be recited at any time when one wants to show remembrance of Allah subhanahu wa ta’ala and the Prophet Muhammad, may peace be upon him.
While praying salah, however, it should be said either during the second rakat or the fourth rakat after completing sujood.
1. It was narrated that Abu Musa Al-Ash’ari said: “The Messenger of Allah (ﷺ) said: ‘When the Imam recites, then listen attentively, and if he is sitting (in the prayer) then the first remembrance that anyone of you recites should be the Tashahhud.’” Grade: Sahih (Darussalam).
2. It was narrated that Ibn ‘Abbas said: “The Messenger of Allah (ﷺ) used to teach us the tashahhud just as he used to teach us a surah from the Quran.” Grade: Sahih (Darussalam) Reference : Sunan an-Nasa’i 1278
3. Ibn Abbas reported: The Messenger of Allah (ﷺ) used to teach us tashahhud just as he used to teach us a Surah of the Qur’an, and he would say: All services rendered by words, acts of worship, and all good things are due to Allah. Peace be upon you, O Prophet, and Allah’s mercy and blessings. Peace be upon us and upon Allah’s upright servants. I testify that there is no god but Allah, and I testify that Muhammad is the Messenger of Allah. In the narration of Ibn Rumh (the words are): “As he would teach us the Qur’an.” Reference: Sahih Muslim 403 a
4. Sahih al-Bukhari hadith number 1202.
5. ‘Ali b. ‘Abual-Rahman al-Mu’awi reported: ‘Abdullah b. Umar saw me playing with pebbles during prayer. After finishing the prayer he forbade me (to do it) and said: Do as the Messenger of Allah (ﷺ) used to do. I said: How did Allah’s Messenger (ﷺ) do? He said that he (the Messenger of Allah) sat at tashahhud, placed his right palm on the right thigh and closed all his fingers and pointed with the help of finger next to the thumb, and placed his left palm on his left thigh.
6. Narrated Abdullah ibn Mas’ud: It pertains to the sunnah to utter the tashahhud quietly. Grade: Sahih (Al-Albani)