It is narrated from Sayyiduna Ka'b bin 'Ujrah (may Allah be pleased with him) that the Messenger of Allah (ﷺ) said to me: "Perhaps you are troubled by lice?" I said: Yes. So he (ﷺ) said: "Shave your head and observe fasts for three days, or feed six needy people, or sacrifice a goat."
Hadith Referenceالسنن المأثورة / باب ما جاء في فدية الأذى / 446
Hadith Takhrijصحیح بخاری، المحصر، باب قول اللہ تعالیٰ : فَمَنْ كَانَ مِنْكُمْ مَرِيضًا الخ، رقم: 1814، صحیح مسلم، الحج، باب جواز حلق الرأس للمحرم أو به اذى ....... الخ، رقم: 1201