When taken as necessary for therapeutic reasons, use of “the pill” is not immoral. Humanae Vitae
states, “the Church does not consider at all illicit the use of those therapeutic means necessary to cure bodily diseases, even if a foreseeable impediment to procreation should result there from—provided such impediment is not directly intended for any motive whatsoever” (HV 15).
Also, in such circumstances, abstinence is not required. For more on this see the post Pill allowed as an abortifacient
For alternatives to the pill check out Pope Paul VI Institute