Suffering entered this corporeal world as a result of mankind not trusting God. Thus, we should trust God.
God's promises are certain. God has promised an eternity without suffering to those that trust in God's Son, Jesus Christ the Lord.
Eternity is an infinitely longer time period than this corporeal life. Christians must evaluate all things in the scope of eternity.
Suffering will exist in this life, until Jesus returns to end it. As long as we exist corporeally, we will have to live with suffering.
Therefore, what is the purpose of suffering? Suffering is a reminder of the result of not trusting God. So, at each moment that we are reminded by suffering, we must shift our thinking and thank God for God's certain promise of our eternal existence without suffering and the relatively extreme brevity of our existence in this suffering world.
Now listen, you who say, "Today or tomorrow we will go to this or that city, spend a year there, carry on business and make money." Why, you do not even know what will happen tomorrow. What is your life? You are a mist that appears for a little while and then vanishes.
Paul and Silas in Prison
Once when we were going to the place of prayer, we were met by a slave girl who had a spirit by which she predicted the future. She earned a great deal of money for her owners by fortune-telling. This girl followed Paul and the rest of us, shouting, "These men are servants of the Most High God, who are telling you the way to be saved." She kept this up for many days. Finally Paul became so troubled that he turned around and said to the spirit, "In the name of Jesus Christ I command you to come out of her!" At that moment the spirit left her.
When the owners of the slave girl realized that their hope of making money was gone, they seized Paul and Silas and dragged them into the marketplace to face the authorities. They brought them before the magistrates and said, "These men are Jews, and are throwing our city into an uproar by advocating customs unlawful for us Romans to accept or practice."
The crowd joined in the attack against Paul and Silas, and the magistrates ordered them to be stripped and beaten. After they had been severely flogged, they were thrown into prison, and the jailer was commanded to guard them carefully. Upon receiving such orders, he put them in the inner cell and fastened their feet in the stocks.
About midnight [after shifting their thinking regarding their suffering] Paul and Silas were praying and singing hymns to God, and the other prisoners were listening to them. Suddenly there was such a violent earthquake that the foundations of the prison were shaken. At once all the prison doors flew open, and everybody's chains came loose [Our prison doors and chains will also soon be no more]. The jailer woke up, and when he saw the prison doors open, he drew his sword and was about to kill himself because he thought the prisoners had escaped. But Paul shouted, "Don't harm yourself! We are all here!"
The jailer called for lights, rushed in and fell trembling before Paul and Silas. He then brought them out and asked, "Sirs, what must I do to be saved?"
They replied, "Believe in the Lord Jesus, and you will be saved—you and your household." Then they spoke the word of the Lord to him and to all the others in his house. At that hour of the night the jailer took them and washed their wounds; then immediately he and all his family were baptized. The jailer brought them into his house and set a meal before them; he was filled with joy because he had come to believe in God—he and his whole family [Others can witness our response to suffering and desire to know Jesus Christ the Lord].
[Text within brackets is my comments]