If I catch them in the act, I said "UH UH" and quickly take them outside or to their litter box. If I don't catch them in the act, I just clean it up! Nothing you can do if you don't catch them in the act.

My dogs never have accidents though - only Reece when he's sick. The cats do sometimes if the litter box is too messy.