Sahih Muslim Book 4, Hadith 76
A hadith like this is narrated by Abu Huraira by another chain of transmitters.
The Messenger of Allah (ﷺ) said: When the Imam says:" Allah listens to him who praises Him." you should say:" O Allah, our Lord for Thee is the praise." for if what anyone says synchronises with what the angels say, his past sins will be forgiven.
The Messenger of Allah (ﷺ) said: SayAmin when the Imam says Amin, for it anyone's utterance of Amin synchronises with that of the angels, he will be forgiven his past sins.