It is narrated from Sayyiduna Ka'b bin 'Ujrah (may Allah be pleased with him) that he was with the Messenger of Allah (ﷺ) when lice caused him (Ka'b) great distress in his head. So the Messenger of Allah (ﷺ) ordered him to shave his head and said: "Fast for three days, or feed six needy people—two mudd of food to each person—or slaughter a goat. Whichever of these you do will suffice you (as expiation)."
Hadith Referenceالسنن المأثورة / باب ما جاء في فدية الأذى / 445
Hadith Takhrijسنن ابی داؤد، المناسک، باب فی الفدیہ، رقم: 1861 وقال الالبانی: صحیح، مؤطا امام مالک، الحج، باب فدیہ من حلق قبل أن ینحر، رقم: 237