You need to work on not letting him get stressed to the level of self-harm. Trying to stop a problem after it starts is too late. When you let his stress reach the boiling point you're going to have to rely on distractions, bribes, or a melt-down room.
If he has a favorite thing (music with headphones, favorite toy or blanket, book, or whatever) make sure to offer it as a first resort, then walk away and let the meltdown pass without your interference. Jabbering at him or trying to hold him down is just going to add to the stress.