You might have heard the expression "Pain is inevitable, suffering is optional." Sometimes it's attributed to the Buddha, but it's much more likely that it originated from an unknown source, coming from some member of Alcoholics Anonymous.
However, the phrase is consistent with the Buddha's teachings, as we see in this quote from the Sallatha Sutta:
“When touched with a feeling of pain, the uninstructed run-of-the-mill person sorrows, grieves, & laments, beats his breast, becomes distraught. So he feels two pains, physical & mental. Just as if they were to shoot a man with an arrow and, right afterward, were to shoot him with another one, so that he would feel the pains of two arrows; in the same way, when touched with a feeling of pain, the uninstructed run-of-the-mill person sorrows, grieves, & laments, beats his breast, becomes distraught. So he feels two pains, physical & mental.”