Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:6:165

And it is He who has made you successors upon the earth and has raised some of you above others in degrees ˹of rank˺ that He may try you through what He has given you. Indeed, your Lord is swift in penalty; but indeed, He is Forgiving and Merciful.  

And He it is Who has made you successors (khalā’if is the plural of khalīfa), in other words, ˹He has made you˺ to succeed one another therein, in the earth and has raised some of you above others in degrees, through wealth and status and otherwise, so that He may try you, that He may test you, in what He has given you, in order to manifest the obedient among you and the disobedient. Surely your Lord is swift in punishment, of those who disobey Him; and surely He is Forgiving, to believers, Merciful, to them. Meccan, except for verses 163-170 inclusive, which are Medinese: it consists of 205 or 206 verses, and was revealed after ˹sūrat˺ Sād.
القرآن:٦:١٦٥

وَهُوَ الَّذِي جَعَلَكُمْ خَلَائِفَ الْأَرْضِ وَرَفَعَ بَعْضَكُمْ فَوْقَ بَعْضٍ دَرَجَاتٍ لِيَبْلُوَكُمْ فِي مَا آتَاكُمْ ۗ إِنَّ رَبَّكَ سَرِيعُ الْعِقَابِ وَإِنَّهُ لَغَفُورٌ رَحِيمٌ  

{وهو الذي جعلكم خلائف الأرض} جمع خليفة: أي يخلف بعضكم بعضا فيها {ورفع بعضكم فوق بعض درجات} بالمال والجاه وغير ذلك {ليبلوكم} ليختبركم {فيما آتاكم} أعطاكم ليظهر المطيع منكم والعاصي {إن ربك سريع العقاب} لمن عصاه {وإنه لغفور} للمؤمنين {رحيم} بهم.