Sunan Ibn Majah, Book 31, Hadith 34 (Ibn Majah 3471)

It was narrated that Abu Hurairah said:

“Mention of fever was made in the presence of the Messenger of Allah (ﷺ), and a man cursed it. The Prophet (ﷺ) said: ‘Do not curse it, for it erases sin as fire removes filth from iron.’”