Praise be to Allah, and peace and blessings be upon the Messenger of Allah.
The squeeze of the grave is established in the Sunnah. Scholars have differed regarding whether it applies universally, and there is no authentic, explicit text establishing that the Prophets, peace be upon them, experience the squeeze of the grave.
A number of scholars held that the Prophets are exempt from it because of their special status and protection. It has been reported from them that they are not squeezed in their graves and are not questioned there in the same manner as other people.
As for the righteous, martyrs, and saints, it is not correct to exempt all of them from the squeeze of the grave. It has been authentically established that Sa‘d ibn Mu‘adh, may Allah be pleased with him, despite his great virtue and high status, experienced the squeeze of the grave.
Accordingly, the apparent view is that the squeeze of the grave applies generally to the deceased, while the Prophets are exempted according to the view of a group of scholars. There is no authentic evidence establishing the general exemption of the righteous or martyrs from it.
A Muslim must therefore prepare to meet Allah, the Exalted, through faith, repentance, and righteous deeds, and ask Allah for steadfastness and safety in the grave.
And Allah knows best.