Kaab bin Ujra reported,

The Messenger of Allah ﷺ stopped beside me while lice were falling from my head, and he asked, "Are these vermin troubling you?"I replied, "Yes."He said, "Then shave your head."He said, It was concerning me that this verse was revealed, "Whoever among you is ill or has an ailment of the head must compensate by fasting, giving charity, or offering a sacrifice" [Baqarah 2:196].The Messenger of Allah ﷺ then said to me, "Fast three days, or give a faraq of food in charity to be divided among six needy people, or sacrifice whatever is easily available to you."

Muslim 2880

Sahih

و حدثنا ابن نمير حدثنا أبي حدثنا سيف قال سمعت مجاهدا يقول حدثني عبد الرحمن بن أبي ليلى حدثني

كعب بن عجرة رضي الله عنه

أن رسول الله ﷺ وقف عليه ورأسه يتهافت قملا فقال أيؤذيك هوامك قلت نعم قال فاحلق رأسك قال ففي نزلت هذه الآية {فمن كان منكم مريضا أو به أذى من رأسه ففدية من صيام أو صدقة أو نسك} فقال لي رسول الله ﷺ صم ثلاثة أيام أو تصدق بفرق بين ستة مساكين أو انسك ما تيسر

مسلم 2880صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Hajj
Chapter
Permissibility of shaving the head for one in Muharram if he has an ailment, the obligation of fidya for shaving it, and an explanation of its amount
Numbering
Darussalam 2880
Muslim 2880