In John 21, Jesus asks Peter "Do you love me" three different times. Part of the reason for this is because it provides a parallel to the 3 times that Peter denied Jesus. Most scholars agree that Jesus and Peter both understand what Jesus is doing with the repetition. Jesus reminding Peter that Peter failed. Perhaps failure is too harsh a word for some people, but Peter did fail. He missed the mark. He abandoned Jesus at Jesus' darkest hour.
Fortunately, Jesus is not only reminding Peter of Jesus' failure. Jesus is also commissioning Peter to do God's work. The difference is that now Peter will be an even better leader. Peter is known to be impulsive, to say big things. Sometimes that gets him in trouble. But Peter is also the one who Jesus appoints to lead the church. This is John's commissioning of Peter. It isn't the same as Matthew's, which records an earlier conversation. In Matthew 16: 19 "And I tell you that you are Peter, and on this rock I will build my church, and the gates of Hades will not overcome it." While it is not the same, it points to Jesus' trust of Peter. It also indicates that Peter must be a humble leader. When I take people through leadership classes, one of the tools I use is called the leadership square. I learned it from a group called 3DM.
This chart shows that we grow through imitation. Peter started off watching, then he helped Jesus, then Jesus helped him, until finally Peter was mature enough to truly be the rock upon which the church was built. The difference is that in stage 2 and 3, people become humble. They learn their limitations. Peter betrayed Jesus, Peter failed. But Jesus did not fail. And Jesus did not give up on Peter. Jesus entrusted Peter with the task of feeding Jesus' sheep. In our lives we may fail. We may betray Jesus. Sometimes when we fail, we give up. Jesus does not let Peter give up, but instead uses Peter's failure to make him a better person for the church. If Jesus can do this with Peter, then Jesus can use you, even if you fail.