Gender Selection. Gender selection is socially controversial. We can do it with ivf/pgd to find male (xy) embryos for transfer. We also screen all chromosomes and reduce risk of downs etc. Not everyone offers it. We also usually limit to "family balancing", that is to help people have an equal number of boys and girls. To have a boy you must already have more girls at home. Do not do for 1st child. See specialist.
Get lucky. The sperm that gets there and fertilizes the egg determines the babies sex. There are no special diets. sexual positions, etc that increase your chances for a specific gender. These are myths that persist because they are right 50% of the time, and people ignore when they are wrong. Unless you are ready to spend big bucks (uncovered by insurance) at a fertility center, you get what you get.
PGD. If you are very serious about only having a baby boy, there are technologies that can enhance your chances. They require ivf (in-vitro fertitilization) with pre-implantation genetic diagnosis, to make sure the embryo being chosen to put into the uterus is male. This can be controversial and for many patients, is too extreme. Otherwise, keep your sperm as healthy as possible by seeing urologist.