Sunan Ibn Majah, Book 36, Hadith 106 (Ibn Majah 4034)

It was narrated from Anas bin Malik that the Messenger of Allah (ﷺ) said:

“The greatest reward comes with the greatest trial. When Allah loves a people He tests them. Whoever accepts that wins His pleasure but whoever is discontent with that earns His wrath.”