Immunity against infections that can cause serious illness is generally beneficial. Since Pasteur provided support for a germ theory of infectious disease, we have increasingly induced immunity against a widening range of diseases to prevent the associated risks from the wild infections. It is hoped that further understanding of the molecular basis of immunity will translate to improved clinical practice in the future.
This article places the development of techniques in historical and logical sequence and points to detailed articles on each of the main topics.
The earliest recorded artificial induction of immunity in humans was by variolation or inoculation, which is the controlled infection of a less lethal natural form of smallpox (known as Variola Minor) into a subject to make him or her immune to re-infection with the more lethal natural form, Variola Major. This was practiced in ancient times in China and India, and imported into Europe, via Turkey, around 1720 by Lady Montagu and perhaps others. From England, the technique spread rapidly to the Colonies, and was also spread by African slaves arriving into Boston. 
Variolation had the disadvantage that the inoculating agent used, Variola Minor, was still an active form of smallpox and, although less potent, could still kill the inoculee or spread in its full form to others nearby. However, as the risk of death from inoculation with Variola Minor was just 1% to 2%, as compared to the 20% risk of death from the natural form of smallpox, the risks of inoculation were generally considered acceptable.
In 1796, Edward Jenner, a doctor and scientist who had practiced variolation, performed an experiment based on the folk-knowledge that infection with cowpox, a disease with minor symptoms which was never fatal, also conferred immunity to smallpox.  Jenner induced cowpox infection by transferring material from a lesion on one patient to another, thus infecting the second patient with cowpox. He then demonstrated that the latter was immune by exposing him to smallpox. The principle had been demonstrated some years earlier by Benjamin Jesty, who had not publicized his discovery. Jenner described and generalised the process and then arranged to propagate cowpox for therapeutic use and he is credited with the discovery. Vaccination took over from variolation.
Pasteur perfected experiments which disproved the then-popular theory of spontaneous generation and from which he derived the modern germ theory of (infectious) disease. Using experiments based on this theory, which posited that specific microorganisms cause specific diseases, Pasteur isolated the infectious agent from anthrax. He then derived a vaccine by altering the infectious agent so as to make it harmless and then introducing this inactivated form of the infectious agents into farm animals, which then proved to be immune to the disease.
Pasteur also isolated a crude preparation of the infectious agent for rabies. In a brave piece of rapid medicine development, he probably saved the life of a person who had been bitten by a clearly rabid dog by performing the same inactivating process upon his rabies preparation and then inoculating the patient with it. The patient, who was expected to die, lived, and thus was the first person successfully vaccinated against rabies.
Anthrax is now known to be caused by a bacterium, and rabies is known to be caused by a virus. The microscopes of the time could reasonably be expected to show bacteria, but imaging of viruses had to wait until the development of electron microscopes with their greater resolving power in the 20th century.
Some diseases, such as tetanus, cause disease not by bacterial growth but by bacterial production of a toxin. Tetanus toxin is so lethal that humans cannot develop immunity to a natural infection, as the amount of toxin required to kill a person is much less than is required by the immune system to recognize the toxin and produce antibodies against it. However, heating the tetanus toxin enough to denature it causes it to lose its ability to produce disease, but still leaves it able to induce immunity to tetanus when injected into subjects. The heated, denatured toxin is called a toxoid.
See also Botulism
The use of simple molecules such as toxoids for immunization tends to produce a low response by the immune system, and thus poor immune memory. However, adding certain substances to the mixture, for example adsorbing tetanus toxoid onto alum, greatly enhances the immune response. These substances are known as adjuvants. Several different adjuvants have been used in vaccine preparation. Adjuvants are also used in other ways in researching the immune system.
A more contemporary approach for "boosting" the immune response of simpler immunogenic molecules (known as antigens) is to conjugate the antigens. Conjugation is the attachment to the antigen of another substance which also generates an immune response, thus amplifying the overall response and causing a more robust immune memory to the antigen. For example, a toxoid might be attached to a polysaccharide from the capsule of the bacteria responsible for most lobar pneumonia.
See also immunoglobulin.
Temporary immunity to a specific infection can be induced in a subject by providing the subject with externally produced immune molecules, known as antibodies or immunoglobulins. This was first performed (and is still sometimes performed) by taking blood from a subject who is already immune, isolating the fraction of the blood which contains antibodies (known as the serum), and injecting this serum into the person for whom immunity is desired. This is known as passive immunity, and the serum that is isolated from one subject and injected into another is sometimes called antiserum. Antiserum from other mammals, notably horses, has been used in humans with generally good and often life-saving results, but there is some risk of anaphylactic shock and even death from this procedure because the human body sometimes recognizes antibodies from other animals as foreign.
Passive immunity is temporary, because the antibodies which are transferred have a lifespan of only about 3-6 months. Every placental mammal (including humans) has experienced temporarily-induced immunity by transfer of homologous antibodies from its mother across the placenta, giving it passive immunity to whatever its mother was immune to. This allows some protection for the young while its own immune system is developing.
Synthetic (recombinant or cell-clone) human immunoglobulins can now be made, and for several reasons (including the risk of prion contamination of biological materials) are likely to be used more and more often. However, they are expensive to produce and are not in large-scale production as of 2006. In the future it might be possible to artificially design antibodies to fit specific antigens, then produce them in large quantities to induce temporary immunity in people in advance of exposure to a specific pathogen, such as a bacterium, a virus, or a prion. At present, the science to understand this process is available but not the technology to perform it.
Further references given in the main articles indicated above.