I've found meltdowns to be unavoidable, and on a longer Camino you can have more than one.
My answer to them is always the same, though the reasons and nature of the meltdowns are quite variable :
1) Stop. This is actually the hardest part of it -- you have to face down your own desire to walk on, and/or desire to give up. Stop, even if you don't want to, and even if your every impulse is against it. It can require subjecting both your desires and your intuition to your intellect as an Act of Will, but it can also be far easier if your body is just extremely fatigued and can't carry on even if you want to.
2) Rest. This means, stay where you are to do so. Organising an escape plan is not resting, grabbing a bus or taxi is not resting, and so on -- most importantly, you're NOT thinking straight when you're in the midst of a meltdown, and so you should make NO decisions unless and until you're out of it. ANY decision made in a state of meltdown is liable to be a bad one, that you'll regret.
3) Wait. Eventually, the meltdown should just go away on its own. Maybe you'll realise you've been pushing your body or your mental endurance too much, or your diet has been wrong, or your pack is too heavy or just badly organised, or maybe there's some psychological issue you need the rest time to make peace with, or you hadn't realised how much you're in need of a comfort food day, or a thousand other problems that time can heal. In any case, keep on waiting at least until you start thinking normally again, and/or the worst of any physical fatigue is resolved.
4) Then make your decision about what to do -- if all goes well, after your rest day(s), carry on your Camino. In any case, your decision when you've rested will be far more likely to be a good one than any hasty decision taken in the midst of your crisis.
5) Buen Camino !!