There are certain kinds of treatments for infertility that would be licit, and many that would not.
The general rule is that if something in the body is not working as it should, we may do what we can to get it fixed. Or if a part of the body is diseased, we may get it healed. We are restoring our bodies to how it was designed to function naturally.
For example, a woman may not ovulate regularly or often. A harmone that encourages her body to ovulate more often, as it should, is acceptable. This is helping the body to operate as it should. In the same way, some women might be able to conceive a child but then does not produce enough of the correct harmone to keep the pregnancy going. So she may take that harmone to suppliment what should have been there but is not. Or a tube may be clogged that carries the ovum. It may be cleared. None of these techniques interferres with the unitative and procreative aspects of the marital act. That means that the husband and wife still join together in the marital act, open to children.
Some types of fertility treatments that would not be permitted include In Vitro Fertilization, (IVF), cloning, use of surragates, sperm donation. These methods lack either the unitative or the procreative aspects of the marital act, or both. They are not working with the natural way things happen. In the first case the egg and sperm are harvested and are joined in a vile or petri dish. There may be multiple eggs and sperm that come together and fertilize, resulting in numerous embryo. If any are to live, they must be implanted in the mother in an unnatural way, not by the father. There may be more than is safe to implant, so then what? With this process, conceived embryos are often destroyed.
Cloninng is also unnatural and lacks the unitative aspect, and the same is true for sperm donation
Taking a pill to prevent conception frustrates the natural process by trying to prevent conception or implantation. It lacks either the unitative or the procreative aspects of the marital act, or both.