וְכֹֽה־תַעֲשֶׂ֤ה לָהֶם֙ לְטַֽהֲרָ֔ם הַזֵּ֥ה עֲלֵיהֶ֖ם מֵ֣י חַטָּ֑את וְהֶעֱבִ֤ירוּ תַ֙עַר֙ עַל־כָּל־בְּשָׂרָ֔ם וְכִבְּס֥וּ בִגְדֵיהֶ֖ם וְהִטֶּהָֽרוּ׃ This is what you shall do to them, to purify them; sprinkle them with the sin-offering waters, and cause a razor to pass over (shave) their entire bodies, and they shall wash their garments and purify themselves
Masechta Nazir 40a
תנן התם שלשה מגלחין ותגלחתן מצוה נזיר ומצורע ולוים וכולן שגילחו שלא בתער או ששיירו שתי שערות לא עשו ולא כלום § We learned in a mishna there (Nega’im 14:4): Three types of people must shave their hair, and their shaving is a mitzva: A nazirite; and a leper, as it is stated: “And he who is to be cleansed shall wash his clothes, and shave off all his hair” (Leviticus 14:8–9). And the third category is Levites, when they were first sanctified for their service, as it is stated: “And this you shall do to them to cleanse them: Sprinkle the water of purification upon them, and let them cause a razor to pass over all their flesh” (Numbers 8:7). And with regard to all of them, if they shaved with an implement other than a razor, or if they left two hairs uncut, they have done nothing, i.e., they have not fulfilled their obligation.
It appears that Leviyim Nezarim and Lepers can use a razor but why can’t anyone other than these three use a razor?