Negative commandment · Lo Ta’aseh #208 of 613
[For a Nazarite] not to enter below any roof beneath which a corpse is found
שלא ייכנס באוהל המת
The verse · Bamidbar 6:6
כׇּל־יְמֵי הַזִּירוֹ לַה׳ עַל־נֶפֶשׁ מֵת לֹא יָבֹא
“All the days that he separates himself to the Lord he shall come at no dead body.”
The Rambam’s words
[For a Nazarite] not to enter below any roof beneath which a corpse is found, as [Leviticus 21:11] states: "He shall not come into contact with any dead body." it appears to be an error, because the passage it introduces deals with the prohibition against a High Priest's coming into contact with a corpse. Perhaps the intended prooftext is Numbers 6:6, "he may not have contact with the dead."
שלא ייכנס באוהל המת, שנאמר "על נפש מת, לא יבוא" (במדבר ו,ו).
Why · Sefer HaChinuch #375
That the nazirite not enter the tent of a dead body
“It is from the roots of the commandment [that it is] because it is known to the Sages that the matter of impurity weakens the power of the intellect and mixes it up and separates between it and the pure and perfect Elevated Understanding.”
Who & when
“And this prohibition is practiced in every place and at all times by males and females.”
Where in the Mishneh Torah
Hilchot Nazariteship הלכות נזירות