It’s always good to understand the alternative to this question also, passive immunity. Passive immunity is that which is acquired from a different person i.e. an unborn foetus acquired immunity to whooping cough after the mother has the pertussis vaccination at around 28 weeks of pregnancy, and again post birth through breastfeeding. If the mother is exposed to a pathogen her body will make antibodies in relation to this which will pass to the newborn/ infant if she is breastfeeding
Active immunity is immunity formed in response to an infection, with the body forming antibodies specific to the antigen which infected the individual.
The immunity which results from the production of antibodies by the immune system in response to the presence of an antigen.