Is there a way to conceive a boy or girl on purpose?

Has anyone ever tried any techniques to purposely conceive a boy or girl and if so which did you try and have any of them worked in your favor?