You need to make sure your female Sim is pregnant first, and you can find out by checking if they vomit in the toilet the morning after you try for a baby.
If you want a baby boy, eat at least 5 apples.
If you want a baby girl, eat at least 5 watermelons.
Warning: Do not eat pancakes if you want a girl, because they will probably be apple, and you may get a boy.
If you want male twins/triplets, listen, watch, and read nothing except things from the children's category and eat at least 3 apples.
If you want female twins/triplets, do the same as you would do if you wanted a boy but instead of eating 3 apples eat 3 watermelons.
If you want to choose the baby's traits when your Sim gives birth to them, make sure you read "Total Preggers: An Expecting Mothers Tale" (it can be purchased from the book store) and get medical advice if you haven't already.
Also, get the father to read the pregnancy book too (if possible) and try to keep the pregnant Sim's mood above halfway.
Do not fight with enemies, and make sure the Sim gets plenty of rest.
Once the baby is born, you will be able to choose one of it's traits if you followed this guide, and perhaps even both of them if you kept the mood bar up to it's maximum!
[more cheats for The Sims 3 here]