"Playing doctor" is so common among young children that it is a rare parent who never sees this game. The reason so many children engage in this exploratory play is that they are curious about what equipment members of the opposite sex have.
Even in a household where the child's questions about sex are answered by the parents and where there has been an opportunity to see siblings of the opposite sex, the child may play an exploratory game with a neighbor.
There are no adverse effects to this game. It is totally harmless and does not lead to early sexual activity, perversion, being "oversexed", addiction to pornography, or any of the other dire things parents may have worried about in the past before we understood early childhood sexuality.
When the toddler first sees a child of the opposite sex the child can be frightened or jealous ("Will I lose mine?" or "Why don't I have one of those?") as well as curious. It takes a while before the child realizes that gender is permanent. Preschoolers begin to practice their roles as males or females and develop pride in their own gender by identifying with the same-sex parent.
While all this is being processed, the child's curiosity is strong. The young child is curious about everything, but how people are made and where babies come from as well as "Where did I come from?" head the list. Children of this age are also often very curious about their own parents and do everything they can to catch you in the toilet or without any clothes on.
A normally curious child who engages in harmless sex play should never be made to feel ashamed or think that he or she did something bad. Our job as parents is to recognize that sexuality starts at birth, that it is a very important part of each human being, and that it is every child's birthright to think of sex as natural, not dirty or shameful.
What should you do when you find your young child engaged in the game of playing doctor? In two words: Chill Out! If you lose your cool or if your child realizes you are upset, you put an emphasis on this harmless game that it does not deserve.
So, don't make a scene, don't yell at the kids, don't laugh, don't send the neighbor child home. Later you can explore the reasons you got so upset; right now, turn into a great actress and project to your audience of four year olds feelings of calm and understanding rather than worry and embarrassment.
Quietly say that you understand they are curious about each other but you would rather they didn't play that game. Say something like, "You see, genitals are private. The rule is get dressed and play something else."
You then use one of the most powerful weapons a parent has: distraction. There isn't a four year old alive who can't be conned by a clever mother into a new game. I always kept spare new games and books around for moments when king-size distraction was needed. When all else fails invite the kids into the kitchen to make cheese cookies. Don't panic, all you need is some cheese slices and a few cookie cutters
Be sure to follow up on the curiosity issue. You can say right then and there something like, "I know children are curious about how other children look. If you have any questions about it, you can ask me." Even if the child doesn't ask you any questions then or later, assume he or she is curious and interpret that fact to the child. "You were curious about how a little girl like Bethany looks. Let me read you this book which explains the difference between boys and girls."
There are only two situations that warrant your concern about sex play in children. If the child persists in such play and seems preoccupied with sexual matters, the child could have a problem and you should tell your pediatrician. Also if one child is older or stronger than the other so that coercion is involved, you must make absolutely sure that the incident can never be repeated. You must tell the parents of the sexually aggressive child what you saw. And I recommend immediate professional help for a sexually aggressive child.
By the way, many modern parents do get upset when they see their child engaged in sex play. It may remind us of the reprimand we likely received when our mother caught us playing doctor or it may force us to realize that children are not innocent cherubs and they grow up too fast! Being modern, knowledgeable parents doesn't exempt us from such feelings but it sure can help us act right in this area.