Do not pray against the sinner rather help him.
Narrated Abu Salama:
Abu Huraira said, “A man who drank wine was brought to the Prophet. The Prophet (ﷺ) said, ‘Beat him!” Abu Huraira added, “So some of us beat him with our hands, and some with their shoes, and some with their garments (by twisting it) like a lash, and then when we finished, someone said to him, ‘May Allah disgrace you!’ On that the Prophet (ﷺ) said, ‘Do not say so, for you are helping Satan to overpower him.’ ”
Reference : Sahih al-Bukhari 6777
Abdullah Bin Masood said:
When you see your brother that he sinned, Do not pray against him by taking satan as a companion that ‘May Allah disgrace and send curse upon you! Rather pray for his aafiyah. We the companions would not say anything to anyone until we know that he died on so and so practice. if he died on khayr, we would hope for his good. And if he died on sharr than we would fear for his amaal. [al Zuhad Ibn al Mubarak 1/313, al Musannaf Abdul Razzaq 11/179 with a powerful chain]
Thabit al Banani said that Obaidullah bin Ziad cut the hands of a theif. People started praying against the thief. So Abū Barza al-Aslamī and ÂİZ b. AMR said: O People! Do not help satan against your brother. Rather praise the Lord who protected you (from this sin and punishment) [at-Tawba li Ibn abi Duniya:115 the chain is hasan]
Via Hafiz Muhammad Tahir