This is ripped off directly from a teaching of the Baal Shem Tov. Here’s a nice translation, straight from the source: Joy Sweetens Judgment.