My son is having a hard time understanding that there is a time and a place to talk about things. Sometimes he says something in a situation where it was just the wrong time and place. How do you handle this sort of thing?
The younger a child is the more likely they are going to say something that totally embarrasses you just because they don't get this. I think by 10 or 11 they start to grow out of that.
You just take him aside and explain this to him. Tell him, it's an important topic but one that should be discussed at home or somewhere else. Don't scold him though.
How old is your son? Younger kids tend to speak whatever coming up in their mind, and that's pretty normal. Just be patient teaching him about that, as he is not going to get it instantly.
Don't expect a toddler to understand what manners are. To avoid any embarrassing situation, don't let him see or hear anything that you don't want others to know about.
Try to not let him hear things that have the potential to embarrass you. If he says something at random now and then, that's no reason to be embarrassed since it's pretty normal.