Until the time that his word came: the word of the LORD tried him. – Psalm 105:19
Trials do not last forever. Cheer up; the tide ebbs out, but the flood will return again. Note the word “until.” He who counts the stars also numbers your sorrows, and if He ordains the number ten your trials will never be eleven. The text says, “until”; for the Lord appoints the bounds of the proud waters, and they shall no more go over your soul when they reach the boundary of the divine “until.” “Until the time that his word came”-the same word which tried Joseph in due time set him free. If the Lord gives the turnkey permission to keep us in prison there we must remain, until He sends a warrant for our liberation, and then all the devils in hell cannot hold us in bondage for an instant longer. My dear brother, I want you in your trouble to look entirely to God, whose word is a word of power. He speaks, and it is done. He has spoken trouble to you, but He can just as readily speak comfort to you. Never mind what the butler’s word is. Do not entreat him, saying, “When it is well with thee speak a word for me.” The butler’s word will not avail, it is Jehovah’s word you need, for “where the word of a king is, there is power.” It is a blessed thing to know that trouble comes direct from God, whatever the secondary agent may be. You must not say, “I could have borne it if it had not been for that wicked woman.” Never mind the wicked woman, look to God as overruling her malice and everything else. He sends the trial, and therefore look to Him to deliver you from it.
“‘Tis He that lifts our comforts high,
Or sinks them in the grave.”
He shuts us up in prison, and He brings us out again. ~ C.H. Spurgeon
https://www.blueletterbible.org/Comm/spurgeon_charles/sermons/1277.cfm