THUS I HEARD: At one time the Gracious One was dwelling near Sāvatthī, in Jeta’s Wood, at Anāthapiṇḍika’s monastery. Then at that time many young boys who were between Sāvatthī and Jeta’s Wood were catching little fish.
Then the Gracious One, having dressed in the morning time, after picking up his bowl and robe, was entering Sāvatthī for alms.
The Gracious One saw those many young boys who were between Sāvatthī and Jeta’s Wood catching fish. Having seen that, he went to those young boys, and after going, he said this to those young boys:
“Are you afraid, boys, of suffering? Is suffering unpleasant to you?”
“Yes, reverend Sir, we are afraid of suffering, suffering is unpleasant to us.”
Then the Gracious One, having understood the significance of it, on that occasion uttered this exalted utterance:
“If you have fear of suffering, if suffering is unpleasant to you, Don’t do any bad deeds, whether in the open or in secret. But if you will do, or now do do bad deeds,
For you there is no freedom from suffering, even after going, while running away.”
Source: Kumāraka Sutta Ud 5.4 Ud 51 https://suttacentral.net/ud5.4