The two angles who will be sent to the grave to question the deceased are called Munkar and Nakeer for general people, and Mubashshir and Basheer for the believer. They question the deceased about his faith: Who is your Lord? Your Prophet? Your Imam? Your Book? Your Qiblah? Believer will reply the proper reply and get mercy from Allah and his grave will be a garden from Paradise, while the non believer will face the disaster and his grave will be a dig from hellfire.
It is narrated in supplications from Ahlul Bayt: O Allah, protect me from Munkar and Nakeer, and make me see Mubashshir and Basheer.(Mafateeh Al-Jinan, A'maal of Rajab).
Proper faith and sincere obedience of Allah saves the believers from the hardships of the grave. Night Prayer, Charity, serving the parents, praying all the prayers on time, reciting Quran, Du'a, Ziyarat of Ahlul Bayt (AS) help in making the grave a peaceful place for the believer.