“The deeper that sorrow carves into your being, the more joy you can contain.”
Kahlil Gibran wrote this in The Prophet, first published in 1923. It appears in On Joy and Sorrow.
Where it appears
And he answered: Your joy is your sorrow unmasked. And the selfsame well from which your laughter rises was oftentimes filled with your tears. And how else can it be? The deeper that sorrow carves into your being, the more joy you can contain. Is not the cup that holds your wine the very cup that was burned in the potter’s oven? And is not the lute that soothes your spirit, the very wood that was hollowed with knives?
From the public-domain edition, read it free.