SN 54.9 Vesālī Sutta: At Vesālī

The Buddha gives many talks on the foulness of the body and then goes into seclusion for half a month. Lots of monks become repelled by their own bodies and kill themselves. When he comes out of seclusion he asks Ānanda “why does the Bikkhu Sangha look so diminished?” He is told about the suicides and then gives a talk on mindfulness of breathing and how to use it to dispel unskillful states.

Full text