It’s good to have options.
On the rare occasion I get side tracked, overwhelmed or have a break in concentration, I take a deep breath in through my nose, out through my mouth (also called “lamaze breathing”) and regroup. Repeat as needed.
I also use prayer, encouraging mottos, (“This too shall pass.” “Don’t sweat the small stuff” “This doesn’t concern you” etc…), yoga type stretches, walking and changing scenery or thoughts.
If all else fails, I call my best friend or Joanne, my co-worker, and “vent.”