The steps of performing the Janazah prayer:
a) To say Allaahu Akbar and to recite Surat al-Fatihah. It is good to recite along with it a short Surah, or a Verse or two, as evidenced by the hadeeth narrated on the authority of 'Abdullah bin 'Abbas (radhiyAllaahu anh).
b) To say Allaahu Akbar for the second time and invoke peace and blessings upon the Prophet :
"Allahumma salli ala Muhammad wa ala ali Muhammadin kama sallaita ala Ibrahima, wa ala ali Ibrahima, innaka Hamidun Majid, wa barik ala Muhammadin wa ala ali Muhammadin kama barakta ala Ibrahima wa ala ali Ibrahima innaka Hamidun Majid."
"O Allah, send Your Favor (Graces and Honours) on Muhammad and on the family of Muhammad as You have sent Your Favour (Graces and Honours) on Ibrahim and on the family of Ibrahim. You are the Most Praised, Most Glorious. O Allah, bestow Your Blessings on Muhammad and on the family of Muhammad as You have blessed Ibrahim and the family of Ibrahim. You are the Most Praised, Most Glorious."
c) To say Allaahu Akbar for the third time and then say:
"Allaahumma-ghfir lihayyina wa mayyitina, wa shahidina wa gha'ibina, wa saghirina wa kabirina, wa dhakarina wa 'unthana.
Allaahumma man 'ahyaytahu minna fa ahyihi 'alal-Islami, wa man tawaffaytahu minna fa tawaffahu 'alal-'Imani.
Allaahumma-ghfir lahu warhamhu, wa afihi wa 'fu 'anhu, wa 'akrim nuzulahu, wa wassi' mudkhalahu, waghsilhu bilma'i wath-thalji walbarad, wa naqqihi minalkhataya kama naqqayta-ththawbal-'abyada minaddans, wa 'abdilhu daram khayran min darihi, wa 'ahlan khayran min ahlihi, wa zawjan khayran min zawjihi.
Wa 'adkhilhul-Jannata, wa 'a'idhhu min 'adhabil-qabr, wa 'adhabinnar, wafsih lahu fi qabrihi, wa nawwir lahu fihi. Allaahumma la tahrimna 'ajrahu, wa la tudillana ba'dahu.
This means:
"O Allah, forgive our living and our dead, those who are with us and those who are absent, our young and our old, our men and our women.
O Allah, whomever You keep alive from among us let him be upon Islam and whomever You take away from among us, take him away in Faith.
O Allah, forgive and have mercy on him, pardon him, and make honorable his reception.
Cause his entrance to be wide and cleanse him with water, snow and ice.
Cleanse him of sins as a white cloth is cleansed of stains. Exchange his hom for a better home, his family for a better family, and his spouse for a better spouse.
Admit him into Paradise, protect him from the punishment of the grace and the torment of the Fire.
Enlarge for him his tomb and shed light upon him in it.
O Allah, do not deprive us of his reward and do not us go astray after him."
d) To say Allaahu Akbar for the fourth time and then to Assalaamu 'Alaikum on the right side only.
It is commendable to raise one's hands with each Takbir.
The Sunnah, or the Prophet's way, to perform Janazah prayer is that the Imam should stand by the head of the deceased if he is a man, or by the middle of the deceased is she is a woman.
If there are children amongst the dead, the boy is to be placed before the woman, and the girl after her. The boy's head should be placed next to the head of the man, and the middle of the woman should be placed next to the head of the man.
If there is a girl amongst them, her head should be placed next to the head of the woman.
Those offering the janazah prayer should stand behind the Imam. If there is one person with the Imam, then the former should stand on the right of the latter.
All Praise is due to Allah and peace and blessings be upon His Messenger, his good family, and his Noble Companions.