I cannot forgive God for the suffering of others; when I look abroad upon His world and behold its cruel destinies, I turn from Him with disaffection; nor do I conceive that He will blame me for the impulse. But when I consider my own fates, I grow conscious of His gentle dealing: I see Him chastise with helpful blows, I feel His stripes to be caresses; and this knowledge is my comfort that reconciles me to the world.

Robert Louis Stevenson (1850–1894) Scottish essayist, novelist, poet
Essay (1880-01/02?), “Reflections and Remarks on Human Life,” § 8.2 “Gratitude to God”
    (Source)

A collection of aphorisms and musings, first published in the Edinburgh Edition of his Works, vol. 28 (1898).