It's going to happen.
How you respond is everything.
Jake Fraley talked today about having a release routine for when things don't go his way or when he doesn't feel quite right.
He looks at the foul pole and says something to restart and get his mind back to the present and drop whatever is going on internally.
When he undoes his batting gloves, he takes a break and when he tightens his gloves, he locks back in.
These are things you can practice and prepare for.