One of my favorite scriptures is in Daniel 3:17-18 where it says:
If it be so, our God whom we serve is able to deliver us from the burning fiery furnace, and he will deliver us out of thine hand, O king. But if not, be it known unto thee, O king, that we will not serve thy gods, nor worship the golden image which thou hast set up.
I love that they have so much faith in God that He will deliver them, but they also know that if not, it will be okay, it will be God's will. Elder Neal A. Maxwell in the October 1994 Ensign said it this way:
We will [not] always be rescued from proximate problems, but we will be rescued from everlasting death! Meanwhile, ultimate hope makes it possible to say the same three words used centuries ago by three valiant men. They knew God could rescue them from the fiery furnace if He chose. 'But if not,' they said, nevertheless, they would still serve him!
I try to remember this as I face challenges in my life, I pray for what I think is right for me and hope that He will give it to me, but if not, I know that I will be alright!