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:2:207

And of the people is he who sells himself, seeking means to the approval of Allah. And Allah is kind to ˹His˺ servants.  

But there are other men who sell themselves, expend themselves in obedience to God, desiring God’s pleasure: this was Suhayb ˹b. Sinān al-Rūmī˺, who emigrated to Medina when the idolaters began to persecute him, leaving them all his property; and God is Gentle with His servants, for He guides them to what pleases Him.
القرآن:٢:٢٠٧

وَمِنَ النَّاسِ مَنْ يَشْرِي نَفْسَهُ ابْتِغَاءَ مَرْضَاتِ اللَّهِ ۗ وَاللَّهُ رَءُوفٌ بِالْعِبَادِ  

{ومن الناس من يشري} يبيع {نفسه} أي يبذلها في طاعة الله {ابتغاء} طلب {مرضات الله} رضاه، وهو صهيب لما آذاه المشركون هاجر إلى المدينة وترك لهم ماله {والله رءووف بالعباد} حيث أرشدهم لما فيه رضاه.