I think it's best to avoid them as much as possible. What I have done is keep a log of what sends me into them so that I can be aware and limit my exposure to these triggers. For me, it's sensory overload, socializing, and stress. Basically, my brain has a certain amount of mental energy it can dedicate to processing, and when that runs out, I hit shutdown.
Given that, what seems to help with recovery is:
- Quiet time
- A dark, cool setting
- Repetitive mindless tasks. For example, mining in Minecraft or looking at memes
- Listening to or watching something I've seen/heard many times before
- Sleep
- Time with calm and quiet people
- If the shutdown is triggered by social issues, then time with someone validating that could help develop a plan.