Not sure if you mean you want to have a boy and not a girl, or if you mean you don't want a woman to get pregnant.
As far as the former...Lot's of myths, but not much science. As far as the latter, the best way to avoid pregnancy
is to not have sex
! if you are having sex, then always use protection!