Some suffering is given in order to chastise and correct a person for wrongful patterns of life (as in the case of Jonah imperiled by the storm), some suffering is given not to correct past wrongs but to prevent future ones (as in the case of Joseph sold into slavery), and some suffering has no purpose other than to lead a person to love God more ardently for himself alone and so discover the ultimate peace and freedom.
Walking with God through Pain and Suffering (ed. Penguin, 2013) - ISBN: 9780698138278