Suffering is a consequence of sin, but it is not always a consequence of personal sin. If this were not so it would be impossible to reconcile the sinlessness of Jesus with the suffering of Jesus. He suffered for his righteousness, not for any sin on his part. So too with Job. Indeed the entire book of Job is a reflection on the reality of undeserved suffering.
The apostles certainly saw this themselves as suffering for righteousness. The apostle Paul affirmed, “we also glory in our sufferings, because we know that suffering produces perseverance” and “just as we share abundantly in the sufferings of Christ, so also our comfort abounds through Christ”. Likewise the apostle Peter observed, “for it is commendable if someone bears up under the pain of unjust suffering because they are conscious of God.” And in the Acts of the Apostles we read, “The apostles left the Sanhedrin, rejoicing because they had been counted worthy of suffering disgrace for the Name.”
So when we see someone suffering, we should take care before concluding it is a consequence of their sin. Their suffering could be the consequence of the sins of others. Consider the family who suffers financial ruin. The suffering of the children comes from the sins of the parents. Consider the murder victim or the rape survivor. The sin lies with the perpetrator. To blame the victim is to misunderstand the situation.