They had 2 groups of people sticking their hand in icy water. One group was allowed to swear, the other group wasn’t. It was found that the people in the group that were allowed to swear were able to keep their hands in the icy water for longer than the people who weren’t allowed to swear.
Normally though when you do hurt yourself, something comes out of your mouth. It might not necessarily be a swear but you don’t just sit in silence going “fiddle dee dee, I just hurt myself”, there is some sort of reaction.