Well, first let’s take care of some terminology confusion.
Birth control is the spacing or planning of children, which is not inherently evil nor forbidden by the Church. Couples can space/plan children by either moral or immoral means.
Contraception is an immoral means of spacing/planning/avoiding children. It is intrinsically disordered (evil) and therefore there is no moral circumstance in which it can be employed. When a couple contracepts they engage in the marital embrace while purposely trying to sterilize it (before, during, or after) via some device, chemical, or action.
Couples who desire to space/plan/avoid children through moral means can do so via either total or periodic abstinence from the marital act. Periodic continence typically employs one of the modern method of natural family planning in which the couple observe the female fertility signs and abstain during the naturally fertile period and engage in the marital act during the naturally infertile period.
When you see people talking about “taking birth control” for this or that medical situation, what they really mean is that their doctor wants to prescribe hormones that also happen to be the same hormones in birth control pills.
It is immoral to contracept by taking birth control pills. It is not necessarily immoral to take these pills as medicine to treat some other condition. But, conditions apply:
Reading humanae vitae, you will see that the Church does not object to treating a disease or medical condition even if it results in the unitendend but foreseen temporary or permanent sterility of the individual involved. This is called lawful theraputic means. The Principle Of Double Effect is also at play here.
So I suggest you read up on Humanae Vitae and the Principle of Double Effect to understand this topic. People often say they are going to “take birth control” but really that is poor wording on their part. What they are actually doing is taking a hormone, not “birth control”.