The process of generating a state of immunity by artificial means. In active immunization, also called vaccination, an inactive or weakened form of a pathogen is administered, inducing B and T cell responses and immunological memory. In passive immunization, antibodies specific for a particular pathogen are administered, conferring immediate but temporary protection