If you read Matthew 14, you run across the very familiar story of Jesus walking on the water. This is the second of three amazing miracles recorded in this chapter. After feeding 5,000 people with nothing but 5 loaves of bread and 2 fish, Jesus sends His disciples ahead of him in their boat to sail to their next destination. After Jesus sends the crowd away, he prays.
Meanwhile, the disciples are dealing with a storm on the sea. Now, in verse 25, Matthew writes that Jesus went out to them. He walked to them ON THE WATER! Wow! The disciples saw Him, but from a distance and through the storm, they couldn't tell it was Jesus at first. The first thing I want to point out here is what Jesus says to comfort them. "Be of good cheer! It is I; do not be afraid." The phrase "it is I," according to my Bible footnotes, can also be translated "I AM." (See Exodus 3:14) I checked my handy dandy E-sword and sure enough the Greek word eimi can be AM and ego can be I. Some interpret this as a claim to deity. I don't speak Greek, but it wouldn't surprise me that Jesus is trying to console His disciples by telling them, "Hey! I'm God! You're lives are in My hands!"
Also, in the midst of this storm, they are told to "be of good cheer." Is it because it's a pleasant situation they're in? Nope. It's because Jesus is there with them.
So anyway, Peter at this point may have realized what Jesus was saying about being I AM. He was, after all, the first disciple to affirm that Jesus is the Messiah. He tells Jesus that if it is Him, allow him (Peter) to come out to Him (Jesus) on the water. Here Peter had faith in Jesus. So guess what, Peter got to walk to Christ on the water. But then, Peter got distracted. There was a storm going on after all. He saw all the problems and hubbub going on around him, and he began to sink. "Lord, save me!" That's all he said, and Christ rescued him.
"O you of little faith, why did you doubt?" Why did Peter doubt Jesus? Because he got distracted. Things around him took his eyes off what really matters--Jesus! After Jesus and Peter got into the boat, the storm stopped (another amazing miracle) and the disciples worshipped Jesus.
This whole narrative is all about maintaining your faith in Christ. We all start to sink at times. Life distracts us with its stresses and worries. Life also distracts us with suffering and death. But through it all, Christ has promised to never leave or forsake those who have faith in Him (see Hebrews 13:5). Through the hard times when we start to sink, we need to call out to the Lord like Peter did, and He will bring us through whatever our situation may be.