He's not finished with you yet.
In Romans 8:18-25, we see a theme of future salvation running throughout. As a matter of fact, Paul points to the glory yet to come as our hope in the midst of pain. So often, we are taught that our only hope is in the finished work of Jesus on the cross for us. In one sense, that is true, but Paul very clearly says that the hope we were saved by is unseen - meaning it hasn't happened yet.
I believe that one of the reasons we are so tempted to question God in our pain is because we either don't understand or meditate on this truth of our future glory. I love the way Peter puts it in 1 Peter 1:8-9 – “Though you have not seen him, you love him; though not seeing him now, you believe in him, and you rejoice with inexpressible and glorious joy, because you are receiving the goal of your faith, the salvation of your souls.”
Peter says that we have not yet fully received the goal of our faith. Jesus absolutely finished the work of our justification at the cross. He defeated death once and for all. But there is still a work of sanctification being done in us and we still eagerly wait for the work of our glorification on the day Jesus returns. This allows us to have hope because we know that even though things are not as they should be, He's not finished with us yet!
On the days that you become frustrated with your sin and suffering, hold on to the hope that God is still working on you and He WILL complete the work that He began (Philippians 1:6). When you can't understand why you are going through certain trials, place your hope in the salvation you have yet to fully see. If we can rejoice so greatly in the work Jesus has already completed, we can surely also rejoice in the work He is still doing and will do.
The secret to being patient in the midst of difficulty - I believe - is to trust the God of the process. If we continuously search for answers to our pain, we are looking to the things that can be seen. But that's not where our hope lies! Our hope is in the things unseen (Romans 8:24-25). Of course you can't see how your pain is working for you yet. That's why we are told to "eagerly wait with patience." The same confidence you have in the finished work of Jesus can be placed in the 'yet to be completed' work of Jesus.
So when you rejoice in the God of your Salvation, understand that you are rejoicing in things still unseen. Understand that you are declaring that God will finish the work that He began and one day all the pain you've been experiencing will fade away because of the glory we will experience when we are face to face with our Salvation.