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:24:32

And marry the unmarried among you and the righteous among your male slaves and female slaves. If they should be poor, Allah will enrich them from His bounty, and Allah is all-Encompassing and Knowing.  

And marry off the spouseless among you (ayāmā is the plural form of ayyim, namely, a spouseless female, whether she be a virgin or one previously married, or a spouseless male), this ˹stipulation˺ relates to free men and free women, and the righteous ones, the believers, among your male slaves and your female slaves (‘ibād is one plural form of ‘abd). If they, the free men, are poor, God will enrich them, through marriage, out of His bounty. God is Embracing, of ˹the needs of˺ His creatures, Knowing, of them.
القرآن:٢٤:٣٢

وَأَنْكِحُوا الْأَيَامَىٰ مِنْكُمْ وَالصَّالِحِينَ مِنْ عِبَادِكُمْ وَإِمَائِكُمْ ۚ إِنْ يَكُونُوا فُقَرَاءَ يُغْنِهِمُ اللَّهُ مِنْ فَضْلِهِ ۗ وَاللَّهُ وَاسِعٌ عَلِيمٌ  

{وأنكحوا الأيامى منكم} جمع أيم: وهي من ليس لها زوج بكرا كانت أو ثيبا ومن ليس له زوج وهذا في الأحرار والحرائر {والصالحين} المؤمنين {من عبادكم وإمائكم} وعباد من جموع عبد {إن يكونوا} أي الأحرار {فقراء يغنهم الله} بالتزوج {من فضله والله واسع} لخلقه {عليم} بهم.