First, you have to produce the semen sample on the day of IUI by masturbation. After the semen is liquefied, it is centrifuged to separate the seminal fluid from the sperm. During this process, chemicals surrounding the sperm will be removed. This is to avoid severe adverse reactions in the uterus should they be inseminated.
The sperm pellet is then suspended in a special fluid medium. In this way, most of the motile sperm will swim out of the pellet into the medium. They are then harvested for insemination.
This procedure takes about 2 hours.