Generally speaking, there is no prohibition against becoming impure, as explained in Why Is Impurity Not Observed? and since nowadays we no longer have the Temple, there is really no reason why a person would take precautions to prevent himself from becoming ritually impure. An exception to this is the male kohen , descendant of Aaron , brother of Moses .

Torah states, “The L‑rd said to Moses: ‘Speak to the kohanim . . . Let none [of you] defile himself for a dead person among his people.’” There is a unique prohibition against a kohen becoming impure by coming into contact with a corpse, regardless of whether he plans on engaging in activities that require purity.

There are, in general, three ways that one could become impure through human remains:

Touching the human remains, known as tumat maga

Moving or carrying human remains, even without touching them, known as tuma t masa

t Being under the same roof or covering as the remains, known as tumat ohel

Thus, morgues, funeral homes or cemeteries are off limits for a kohen except for the funerals of certain immediate relatives (with restrictions).

This brings us to the question of a kohen visiting a museum or hospital, which may contain human corpses or remains. Depending on the layout and other factors, if all the rooms in the building are connected via airways (doors, ducts, etc.), tumat ohel spreads throughout the entire building. Therefore, if even one room in the hospital or exhibit in the building contains a corpse, the kohen might have to refrain from stepping in the whole building.

There is, however, a distinction between Jewish and non-Jewish remains.