I find that when I've said something stupid, it's often best to just retract it and apologize instead of trying to defend it. Sometimes by defending it, you just dig yourself in deeper.Likewise, when somebody else says something stupid, it's sometimes better to ignore it than to try to talk it out. Calling attention to it sometimes just provokes defensiveness (or counterattack) from the other person.
Notice I had to qualify every sentence so far in this message with "often" and "sometimes." Knowing when to apply these principles is a trick I haven't mastered yet.