Not all affliction is for specific sins. God often sends affliction to purify and strengthen our faith, for his glory.
In this you greatly rejoice, though now for a little while you may have had to suffer grief in all kinds of trials. These have come so that your faith of greater worth than gold, which perishes even though refined by fire may be proved genuine and may result in praise, glory and honor when Jesus Christ is revealed. .