There are various methods for sorting sperm, including flow cytometry, which uses a laser to differentiate between X and Y sperm based on their DNA content. Other techniques involve density gradient centrifugation or the use of specialized dyes. The selected sperm are then used to fertilize an egg either through IVF or intrauterine insemination (IUI).