If they are little then you simply tell them to get dressed and explain that “playing doctor” is not an acceptable activity. Then give them something more appropriate to do, like break out coloring books and crayons.
If they are old enough to think they know what they are doing, you tell them to stop it, send the other one home, and then explain the birds and bees, acceptable standards of behavior and consequences for doing otherwise to your child.
If they are over 18, tell them to get a room.