Zohar 180b. The Zohar speaks about ideas related to the punishment of tzaddikim, why the tzaddikim are so often punished and harmed in this world on a constant basis. One reason given is that as the body becomes weaker, so does the neshomo become stronger, and then the yetzer tov can be victorious over the yetzer hara and the tzaddik can do avodas Hashem without any problems. The question is asked in regards to tzaddikim who are healthy and look good (meaning, no disfigurations or obvious injuries). The Zohar answers that this is due to the fact that they are tzaddikim bnei tzaddikim, whereas those who are injured and given problems are not. Sometimes we see those tzaddikim who are doing great have parents who are not tzaddikim and vice versa, basically the ways of Hashem are truth and we can’t worry about this too much. The next aspect regards the birth of a person when the moon is in her damage, meaning the moon is weakened, which means the kochos of the Shechina are damaged as she isn’t being unified with Z’eir Anpin, the Sefiros of Malchus and Tiferes aren’t in connection, but she still has to produce people’s souls. The souls of those born in this time are afflicted their whole lives, and the only thing that can fix this is tefillah, because tefillah nullifies all judgements. That part closes with the opposite, that in a good time the person born then has everything he needs in wealth and children and health.
From this section we can learn something out l’maaseh from the Gemoro in Brochos, which discusses the forms of problems, such as issurim shel ahavah (problems because Hashem loves us) and stam issurim, meaning problems that are meant to cause us to do tshuva. There are various shittos as to what the difference is, the main two to consider due to their general relevance are in regards to whether one can pray or can learn. Rebbe Nachman zy’a states in Likkutei Moharan that if one can still daven, then he has issurin shel ahavah, which means that the problems are intended to make him more holy and grant him reward in Olam Habu. This Zohar states that davening is the way to remove the dinim and nullify harsh decrees. Clearly this means tefillah from the heart, not simply murmuring a few pesukim from Tehillim. The reason this works is because tefillah leads to a unification of the Shechina and Z’eir Anpin, which leads to further yichudim up the ladder as explained in the sifrei kabbalah. When a person is able to daven, he can accomplish various other actions in regards to the problem, whether or not it’s isurim shel ahavah. It’s said in the Gemoro in Shabbos that the Shechina rests by the head of a sick person, which means it’s a good place to be mispalel for another person, kal v’chomer for the sick person himself!
This is perhaps another pshat on why tzaddikim are given issurin (troubles) on the whole, taking the reasons given above all into account. As the body is weaker in a given aspect, the person learns to rely less on the body, rather to rely on Hashem alone. Due to this, he spends more time involved in avodas hakodesh (holy service), rather than in the narishkaiten of the world. From this involvement, when he’s not too sick to learn, he gains a greater d’veikus to HKB’H, as it says “Kudsha Brich Hu V’Oraisa Kulo Chad,” Hashem and His Torah are totally unified, and through learning Torah lishmoh one draws down incredible hashpues, Divine influences, from the higher worlds and brings reparations to all the lower worlds, especially within himself. When the time comes that he can daven or must daven, then he can daven with true kavono, and with the power of that tefillah he can remove the wretched decrees from the world and sweeten the judgements upon us. Through the perfection brought about through suffering and limud haTorah, and iyun b’avodas HaBorei, the person comes to be a tzaddik. Rather than the tzaddik is simply chosen to be tortured so he can receive more reward in the Next World, I believe it can be clearly learned out from this source and others as well that the purpose of the tortures is to help a person develop into a tzaddik. As it says in Likkutei Moharan, a person who does mitzvos without desiring any reward whatsoever gets reward in this world, therefore the same should apply to trouble in this world.
Hashem should help us all become tzaddikim and to serve Him in truth and happiness, we should also merit the geulah shleimah swiftly in our days.