Allah the Exalted states:
وَالَّذِیۡنَ جَاھَدُوۡا فِیۡنَا لَنَھْدِیَنَّھُمۡ سُبُلَنَا
Meaning, those who strive in Our cause shall be guided. In other words, a person must join God’s Messenger, and strive and endeavour in this path together with him. It does not behove one who strives in the cause of Allah to flee within an hour or two. In fact, the task of such a person is to remain forever ready to give their life. So, the hallmark of a righteous person is steadfastness. In this regard, Allah the Exalted states:
اِنَّ الَّذِينَ قَالُوا رَبُّنَا اللهُ ثُمَّ اسْتَقَامُوْا
Meaning, they say our Lord is Allah, then show steadfastness; and turn away from all else to find God. In other words, success depends on steadfastness. And steadfastness is to recognise God and stand unshaken in the face of all difficulty, trial and tribulation. If a person is able to do this, they will surely become the recipient of divine communion and converse like the Prophets.
(Hazrat Mirza Ghulam Ahmadas, Malfuzat, Vol. 1, pp. 23-24)