A bunch of eggs are harvested from women (induced by injections) and then fertilized by sperm from men (usually the husband but not always)
These fertilized eggs are allowed to begin growing to a certain point. Then they are now embryos. And because of genetic testing they can determine all they need to know about what that embryo is going to become. Boy or girl...whatever.
Now mom usually only wants to have one baby at a time...so one is chosen (according to the choices mom makes) and the rest are frozen but still viable for implantation.
We are talking about up to a dozen or more eggs at a time are fertilized.
So...the embryos are kept frozen until they are destroyed or allowed to be bought/adopted by a couple who can't/wont have children due to genetic diseases. Here's an article with more information....but trust me when I say that they can screen for anything and everything.
https://www.wired.com/story/genetic-screening-ivf-healthiest-embryos/