“But the Lord was with Joseph and showed him steadfast love and gave him favor in the sight of the keeper of the prison.” (Genesis 39:21, ESV)
When I pray, I usually pray for success, for health, for solutions, for deliverance—I tend to pray for triumph. Whatever the situation is, my prayers are for the best possible outcome as I envision it. I see nothing wrong with that, but I do find it interesting how God responded in Joseph's life.
I don't think it would be too much to assume that young Joseph was praying during these hard times.
I'll bet he prayed for deliverance from the Midianites who bought him, and yet he was sold to Potiphar. I'll bet he prayed for deliverance from Potiphar, but instead God chose to prosper Joseph and keep him in Potiphar's house. When Potiphar's wife falsely accused Joseph, I'm sure he prayed that he would be vindicated, instead he was thrown in prison.
Yet even as his situation seemed to be growing continually worse, Genesis records that the Lord was with Joseph and showing him steadfast love, not by answering his prayers for deliverance (which he was no doubt praying again), but by giving him favor in the eyes of the keeper of the prison.
Would Joseph have counted this as a triumphant answer to prayer? Was Joseph just basking in the steadfast love of the Lord in those circumstances? Maybe. Although, if he was anything like me, likely not. Yet whether Joseph understood it or not, the Lord was pouring out steadfast love upon his child.
The Lord's love for his children is true and unshakable, even if it cannot be measured by the number of times he has said "yes" or by how much we enjoy our present circumstances.
Whether you are in good times or affliction, may you rejoice today in the steadfast love of your heavenly Father.