Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
What can we do to ensure our faith remains firm?
We remain firm by asking Allah for firmness, keeping the company of the pious and spending time in remembrance of Allah and reflection.
We should also repeat these supplications:
رَبَّنَا لاَ تُزِغْ قُلُوبَنَا بَعْدَ إِذْ هَدَيْتَنَا وَهَبْ لَنَا مِن لَّدُنكَ رَحْمَةً إِنَّكَ أَنتَ الْوَهَّابُ
Rabbana la tuzigh qulubana ba`da idh hadaytana wa hab lana milladunka rahmatan innaka anta’l-wahhab
Our Lord, do not let our hearts deviate after You have guided us, and grant us mercy, for truly You are the Bestower of bounties without measure!
يَا مُقَلِّبَ القُلُوبِ و الأَبْصَارِ ثَبِّتْ قَلْبِي على دِينِكَ
Ya muqallib al-qulubi wa’l-absar thabbit qalbi `ala dinik
O Turner of people’s hearts and eyes, make my heart firm upon the religion!
يَالله بِهَا يَالله بِهَا يَالله بِحُسْنِ الْخَاتِمَة
Ya Allah biha ya Allah biha ya Allah bi husni’l-khatimah
O Allah, O Allah, O Allah, we ask You for a good ending!