When one has emunah, every situation is a reason to rejoice. In
every situation one can serve Hashem.
In Photiphar’s house, Yosef had many tests with the mitzvah "Don’t stray after your heart an after eyes." He could have thought, “I used to be in Yaakov Avinu’s home, how did I end up here, with such tests?” But Yosef realized that every situation is Hashem’s plan.
There was a renowned Slonimer chassid called Reb Mordechai (Motke)
Leider zt'l. Once, as a yungerman, he collapsed in the beis medresh, and
people succeeded to revive him. The next day he came to the beis
medresh and said, "Yesterday I almost made the kuntz" (trick, implying that he almost died and went up to heaven).
Another renowned Slonimer Chosid, Reb Elazar Katz zt'l replied, "What did you say? That you almost made 'the kuntz'? How would you survive up
there in heaven? You don’t have there לא תתורו (the mitzvah to be cautious with one's eyes)."
Because the true kuntz is to be in this world, and to pass all the tests Hashem sends us in life.