While there are many ideas and anecdotal stories in actuality there is no reliable way of making sure your baby is going to be of a particular sex when planning your pregnancy. No approach such as what you eat or timing of sexual intercourse in the menstrual cycle, etc has been proven to be reliable. It is the male sperm that determine sex rather than the female egg. In some male families there is a predisposition to one sex or other. But even then there are exceptions.
Sex determination after conception
Chorionic villus sampling (CVS), amniocentesis and the new non-invasive prenatal test (NIPT) are reliable ways of determining your baby’s sex.
The next most reliable is ultrasound scan. I have been able to determine the baby’s sex as early as 14 weeks pregnancy. Boys are easier to confirm than girls. Also whether the baby is positioned with its back towards your back (facing up), how still your baby is at the time of being scanned, you being of slim build (less adipose tissue in your anterior abdominal wall), the quality of the ultrasound machine, the expertise of the scanner all are factors that are relevant in whether or not it is possible to accurately determine your baby’s sex at early scanning.
About 60% of couples want to find out the sex at that scan and 40% don’t want to know the sex until after the baby is delivered.
Other approaches have been tried over the years. While they may be fun to do they have no proven accuracy.