The purpose for testing and trials is to grow and mature us in Christ. Every time we overcome, we become a channel to help other believers. The devil asked and received permission to sift Peter like wheat. Jesus did not pray that Peter be spared, but that his faith would remain strong during and after the sifting.
The Lord followed His statement to Peter regarding the fact that the devil wanted to sift Peter by saying, “But I have pleaded in prayer for you, Simon, that your faith should not fail. So when you have repented and turned to me again, strengthen your brothers.” Luke 22:31-32 (NLT)
This verse gives me the reason why God allows the devil to shift the believer. Because after we repent and are restored we become stronger in our walk with Christ. And when we overcome we become a conduit to help other believers overcome. “So when you have repented and turned to me again, strengthen your brothers.”
Let me encourage you. Your turn around will happen, just stay strong in your faith. After you turn, you will see the purpose of the sifting. And as Peter was commanded to do, strengthen your fellow believers who are weak.