שֶׁתּוֹעֶלֶת גָּדוֹל הוּא תְּפִלּוֹת צַדִּיקִים לַנְּשָׁמוֹת הַנִּדָּחוֹת, וְאֵין לְךָ גְּמִילוּת חֶסֶד גָּדוֹל מִזֶּה, וְאַף כִּי אָנוּ אֵינֶנּוּ מֵאַנְשֵׁי הַצַּדִּיקִים הַקּוֹדְמִים, וְהַלְוַאי שֶׁתּוֹעִיל תְּפִלָּתֵנוּ לְתוֹעֶלֶת עַצְמֵנוּ, לְכַפֵּר חַטֹּאתֵינוּ וּפְשָׁעֵינוּ שֶׁהִכְעַסְנוּ לַבּוֹרֵא יִתְבָּרַךְ בְּמֶרֶד וּבְמַעַל, אַף עַל פִּי כֵן הַיּוֹדֵעַ מַחֲשָׁבוֹת הַטּוֹבוֹת, לִהְיוֹת זֶה מֵהַמְזַכִּים בִּתְפִלָּתָם גַּם לַנְּשָׁמוֹת הַנִּדָּחוֹת, כִּי רַב חֶסֶד הוּא הַבּוֹרֵא יִתְבָּרַךְ, וְזֶה יֵאוֹת לְכָל בַּר יִשְׂרָאֵל לִהְיוֹת זוֹכֶה וּמְזַכֶּה לַאֲחֵרִים. וּמִכָּל שֶׁכֵּן שֶׁצָּרִיךְ הָאָדָם לְהִתְפַּלֵּל עַל רִשְׁעֵי הַדּוֹר שֶׁיַּחְזְרוּ בִּתְשׁוּבָה, כִּדְאִיתָא בַּגְּמָרָא דִּבְרָכוֹת (י, א), בִּבְרוּרְיָא דְּבִיתְהוּ דְרַבִּי מֵאִיר שֶׁאָמְרָה: "יִתַּמּוּ חַטָּאִים" כְּתִיב (תְּהִלִּים קד, לה), וְלֹא חוֹטְאִים. עַל כֵּן אֲסַדֵּר אֲנִי לְפָנֶיךָ לְכָל אִישׁ וְאִשָּׁה, לוֹמַר יְהִי רָצוֹן זֶה בְּבִרְכַּת "הֲשִׁיבֵנוּ אָבִינוּ לְתוֹרָתֶךָ, וְקָרְבֵנוּ מַלְכֵּנוּ לַעֲבוֹדָתֶךָ", וְיֹאמַר:
...the prayers of the righteous are of tremendous benefit to the souls of the banished.
There can be no greater act of loving-kindness than this.
Obviously we are not in the same league as the righteous of earlier generations. We would have reason enough to be thankful if our prayers were adequate to benefit ourselves and to atone for the sins and transgressions and the rebelliousness and deceit with which we have angered our Creator.
Nevertheless, one should strive to be among those who benefit these banished souls with their prayers and then the Creator, may He be blessed, will exercise His abundant loving-kindness.
Indeed it is fitting for every Jew to strive to benefit others.
One should pray especially on behalf of the wicked of the generation that they should repent.
Thus we learn in Berachos (10a) that Rabbi Meir’s wife Beruryah said to him, “It is written, ‘let sin come to an end’ (Tehillim 104:35), not the sinners!”
Therefore I will set out here for the use of every man and woman a Yehi ratzon prayer to be added to the blessing, “Return us our Father to Your Torah and draw us near to Your service,” the fifth blessing of the Amidah. The text of the prayer is as follows:
וְאָז יִתְעוֹרֵר גַּם הָאָדָם מֵעַצְמוֹ לַעֲשׂוֹת תְּשׁוּבָה עַל חֲטָאָיו, כְּדֵי שֶׁלֹּא יֵאָמֵר לוֹ "קְשֹׁט עַצְמְךָ וְאַחַר כָּךְ קְשֹׁט אֲחֵרִים". רַק שֶׁיֹּאמַר בְּכַוָּנַת הַלֵּב, וְאָז בַּעַל הָרַחֲמִים, בְּרֹב חֲסָדָיו וּבְרֹב רַחֲמָיו, יְקַבֵּל תְּפִלָּתוֹ. וְאַף שֶׁצָּרִיךְ תְּפִלָּה זוֹ כַּוָּנוֹת וְיִחוּדִים, וְאֵין אָנוּ בְּקִיאִים בְּשֵׁמוֹת וּבְצֵרוּפִים, הַמּוֹעִילִים לְתוֹעֶלֶת גָּדוֹל, מִכָּל מָקוֹם יִתְפַּלֵּל בִּקְצָרָה, וִיבַקֵּשׁ בְּהֶגְיוֹן לֵב, כִּי כָּךְ רָאוּי וְנָכוֹן לְכָל הַמִּתְפַּלֵּל, שֶׁלֹּא יַאֲרִיך הַכֹּל בִּשְׂפָתָיו, כִּי יַשְׁאִיר לוֹ בְּהֶגְיוֹן לִבּוֹ.
After reciting this, a person will arouse himself as well to repent for his sins so that they will not chide him, “Adorn yourself and then adorn others!”
If he will only recite this prayer with heartfelt intent surely the Merciful One, in His abundant loving-kindness and mercy, will accept his prayer.
And even though this prayer should really be accompanied by esoteric meditations in which we are not fluent, nevertheless, let him pray briefly and think these requests in his heart. For it is proper for everyone to leave such requests to the meditations of the heart and not speak out everything with his lips.
Either way, this is the source for the prayer and here it is if you don't have it in your siddur.
May we all do teshuvah from love and not from trials or tribulations.