"Non-Christians mistakenly judge happiness as possessing their desires, while being relieved of all troubles."
Happiness is having our sins covered with the blood of Christ and no longer held against us. (Romans 4:7,8).
Trying to be happy without the truth of God's Word is like trying to have a bright day without sunshine."
"When will we ever learn to seek happiness by limiting our desires,
rather than attempting to satisfy them?"
(John Stuart Mill)
Joseph's happiness in God was much greater than his non-believing employer and his wife
would ever be.
Joseph's later confinement, which you can read about in God's Word, was nothing compared to the wretched confinement of that family's sin.