If not in a controlled fighting environment, such as a ring, try to keep your wits and not focus on the person who struck you. Instead, use your peripheral vision to detect any other assistants who may be present. Do not think about the pain or yourself; instead, think about the situation in which you are in, and how you may improve it. The time to consider your reaction to pain is not just after you have been hit, it is in the months and years leading up to getting hit when you trained your mind and body to deal with this moment.
Boxers strengthen their necks so they will be able to keep the head more stable when it is struck. To do this, they may use a head strap connected to a pulley and a weight, and perform repetitions of moving the neck in different directions. They may also use a neck strap connect directly to a weight, lie with their heads hanging over the edge of the ring so the weight hangs down, and then move their heads up and down.
Practice getting hit. Spar with headgear, mouth protector, and gloves and use moderate contact. Increase the level of intensity and power of the punches as you and your partner develop a tolerance for getting hit. This will also help you learn not to flinch when a punch is approaching. Learn to keep your eyes open during an attack. It is instinctive to close your eyes when something is coming toward them, but you cannot avoid or block what you cannot see. As you spar more, you will learn to face a punch and deal with it. The more you get hit, the less fear you have of getting hit. When you do not fear getting hit, you are more relaxed, which means you will be able to react and move more quickly, which means you will be hit fewer times.