How can I avoid triple confirmation modals

While at the supermarket a while back, one of the actions the clerk performed on the POS had a triplet of confirm modals on it, literally:

Are you sure you want to <action>?

Again, are you sure you want to <action>?

For the third time, are you sure you want to <action>?

How could this have been designed better?