The bible teaches us that people who are suffering does not really mean they are bad and people and those who are prospering doesn't mean they're also good people. In the bible Job suffered a lot even when he is good and serving God with his pure heart. So we must have it in mind that trial will always come even when we are in a good relationship with God. God allows his own people to suffer sometimes to test their faith, anyone who passes it becomes more closer and have more faith in God. Suffering is inevitable provided you're following God.
The holy book of God tells us that the success of the bad people doesn't last forever. Sometimes around us we find out that evil people succeed more than us that is good people. But we must know that their prosperity won't last. God is watching everything that is happening and at the right time he will make his own people to enjoy. The bible teaches us have hope in God and trust that will make a way for us.