The Messenger of Allah ﷺ said, "How good it is for a slave to be taken in death while worshipping Allah well and serving his master faithfully. How good that is for him."
وقال رسول الله ﷺ نعم ما للمملوك أن يتوفى بحسن عبادة الله وصحابة سيده نعما له
A sahih hadith, narrated by Muslim, vol. 5, p. 65.Tirmidhi narrated, "How excellent it is for one of you to obey Allah and fulfill the right of his master," meaning the slave. Tirmidhi narrated it in the chapter on righteousness, from Muhammad bin Yahya bin Abu Umar.Kaab said, "Allah and His Messenger have spoken the truth."