How to Pray Salat al-Janazah
Question

Please explain to us how the funeral prayer is to be offered, as reported from the Prophet (peace and blessings of Allah be upon him), because many people do not know about it.
Praise be to Allah.How to pray salat al-janazah
The Prophet (peace and blessings of Allah be upon him) and his Companions (may Allah be pleased with them) explained how to pray salat al-Janazah (funeral prayer). It is done as follows:

You say the first Takbir (“Allahu akbar”), then you seek refuge with Allah from the accursed Shaytan. Then you say Bismillah ir-Rahman ir-Rahim and recite al-Fatihah . 
Then you say Takbir and send blessings upon the Prophet (peace and blessings of Allah be upon him) as one does at the end of the prayer. 
Then you say a third Takbir and make du’a for the deceased. 
Then you say a fourth Takbir and pause for a little while, then you say one Taslim to the right, saying “Assalamu ‘alaykum wa rahmatullah.” 

The best dua for the deceased
The following dua was narrated from the Prophet (peace and blessings of Allah be upon him):
“Allahumma ighfir lihayyina wa mayyitina wa shahidina wa ghaibina wa saghirina wa kabirina wa dhakarina wa unthana. Allaahumma man ahyaytahu minna fa ahyihi ‘ala’l-Islam wa man tawaffaytahu minna fa tawaffahu ‘ala’l-iman. Allahumma ighfir lahu warhamhu wa ‘afihi wa a’fu ‘anhu, wa akrim nuzulahu wa wassi’ madkhalahu waghsilhu bi’l-ma wa’l-thalj wa’l-barad, wa naqqihi min al-khataya kama yunaqqa al-thawb al-abyad min al-danas. Allahumma abdilhu daran khayran min darihi wa ahlan khayran min ahlihi. Allahumma adkhilhu al-jannah wa a’idhhu min ‘adhab il-qabri wa min ‘adhab il-nar wa afsah lahu fi qabrihi wa nawwir lahu fihi. Allahumma la tahrimna ajrahu wa la tadillana ba’dahu
(O Allah, forgive our living and our dead, those who are present among us and those who are absent, our young and our old, our males and our females. O Allah, whoever You keep alive, keep him alive in Islam, and whoever You cause to die, cause him to die with faith. O Allah, forgive him and have mercy on him, keep him safe and sound and forgive him, honour the place where he settles and make his entrance wide; wash him with water and snow and hail, and cleanse him of sin as a white garment is cleansed of dirt. O Allah, give him a house better than his house and a family better than his family. O Allah, admit him to Paradise and protect him from the torment of the grave and the torment of Hell-fire; make his grave spacious and fill it with light. O Allah, do not deprive us of the reward and do not cause us to go astray after this).” 
If you make du'a’ with other words, this is OK, for example, you could say: “Allahumma in kana muhsinan fa zid fi ihsanihi wa in kana museean fa tajawaz ‘an sayiatihi. Allahumma ighfir lahu wa thabbit-hu bi’l-qawl il-thabit (O Allah, if he was a doer of good, then increase his good deeds, and if he was a wrongdoer, then overlook his bad deeds. O Allah, forgive him and give him the strength to say the right thing).” 
And Allah knows best.
For more about Janazah prayer related issues, please see these answers: 35853 , 106423 , 8192 , and 14522 .