If you’re like me, your social media feed has been filled with people’s vacation photos lately. From sandy beaches to mountains to national monuments, there are countless picture-perfect, Instagram-worthy photos to see online.

Recently, during a trip to the mountains, I had hoped to get a good photo, too. “Where better to get a social-media-ready photo than during a river rafting adventure?” I thought.

So there we were. Rafting down a river—not even one of the most advanced rapids—waiting for my photo moment in the sun. When suddenly, our raft got stuck on a rock. In spite of our rafting guide’s best efforts, our raft flipped, and we all fell into the chilly water.

Now, with all this heatwave, the cold water was actually refreshing; and the moment was humorous, once we were all ashore. But I never did get that perfect photo moment.

Has that ever happened to you, too? I don’t mean just your boat being capsized. I mean, has your longed-for Instagram moment gone wrong? Or perhaps worse, that “dream vacation” or experience you had in mind was totally ruined by bad attitudes, wrong turns or other misfortunes.

It seems that happens in life a lot. We each fall into pits—some serious, some less serious. For some, it was our own sin that got us into a pit. For others, it was misfortune. Still others, bad people doing bad things placed them there.

Whatever the case, when that happens, remember we have the Lord looking out for us. The Bible says in Psalm 40:1-4:

I waited patiently for the LORD; He turned to me and heard my cry.

He lifted me out of the slimy pit, out of the mud and mire; He set my feet on a rock and gave me a firm place to stand.

He put a new song in my mouth, a hymn of praise to our God. Many will see and fear the LORD and put their trust in Him.

Blessed is the one who trusts in the LORD, who does not look to the proud, to those who turn aside to false gods.

I love those verses. Notice when we call out to the Lord in despair, He is the one to lift us up. He is the one to set us on a solid foundation. Not only that, He puts a song of praise on our lips.

Has your life taken a turn for the worse recently? It could be in your relationships, your finances or your health. Whatever pit you find yourself in, call out to the Lord in prayer for help. Look to Him to rescue and restore you.

When you do, you may still not have an Instagram-worthy picture out of it. But you will find yourself instantly in a better boat, following His will and Word.