Doing Dua to live and die with the righteous:
The Quran prescribes to adopt righteous company at all levels and stages of existence in both the worlds.
We are commanded to live with the righteous, die with the righteous and even to enter the Jannah with the righteous.
And this applies to every single person. Even the Prophets have prayed for the righteous company.
Some of these verses are given below:
"So, enter among My [righteous] servants and enter My paradise." (Quran, 89:29).
Here, Allah says about the purest and most pious people who have attained 'Nafs e mutmainnah' (the contented soul) that they will ﬁrst be asked to enter the fold of righteous slaves, and then to enter the Paradise.
This indicates that entry into Paradise depends on their being, ﬁrst and foremost, in the fold of the righteous believers. Then they will all enter Paradise together.
This also shows that a person joining the company of the righteous in this world is a sign that he will enter Paradise with them.
Even the prophets of Allah prayed to be joined with the righteous:
The Prophet Sulaiman عليه سلم prayed:
وَأَدْخِلْنِي بِرَحْمَتِكَ فِي عِبَادِكَ الصَّالِحِينَ
"..and admit me, by Your mercy, among Your righteous slaves." [27:19]
The Prophet Yusuf عليه سلم prayed:
تَوَفَّنِي مُسْلِمًا وَأَلْحِقْنِي بِالصَّالِحِينَ
"Cause me to die a Muslim and join me with the Righteous." (12:101)
Allah has taught us to pray that even the death comes among the righteous:
رَّبَّنَا إِنَّنَا سَمِعْنَا مُنَادِيًا يُنَادِي لِلْإِيمَانِ أَنْ آمِنُوا بِرَبِّكُمْ فَآمَنَّا ۚ رَبَّنَا فَاغْفِرْ لَنَا ذُنُوبَنَا وَكَفِّرْ عَنَّا سَيِّئَاتِنَا وَتَوَفَّنَا مَعَ الْأَبْرَارِ
"Our Lord, indeed we have heard a caller calling to faith, [saying], 'Believe in your Lord,' and we have believed. Our Lord, so forgive us our sins and remove from us our misdeeds and cause us to die with the righteous."
Holy Quran, 3:193
آمين يا رب العالمين