I always carry a CO2 inflater for this reason. A couple of hints:
Locate the valve at 12 o’clock when pumping up to stop the sealant squirting out.
If the bead is still seated, then a hand-pump might work (try to pump the tyre up before it gets too bad).
If not, CO2 will get you back up and running, but will definitely set off the sealant, so change it when you get home.
Alternatively, fit a tube if it’s a bad flat or sidewall gash to get you home. This is a last resort, and messy, but sometimes is the only way.
For what it’s worth I’ve had fewer than 5 flats in the last 3 years of running tubeless. The extra faff when you get problems is more than made up by the lack of punctures.
Buy a CO2 inflater that uses non-threaded cartridges – they are marginally cheaper to buy.