Short answer
The Prophet ﷺ said that whoever has hair should honour it. The Sunnah is to keep the hair clean, combed and oiled, to start from the right, and to part it in the middle, without making it a daily obsession: he discouraged combing every day for show. The Hanafi school counts this care as mustahabb. The four schools agree.
Keeping the hair and beard clean, combed and oiled is mustahabb. Excessive daily styling for show is disliked, and leaving the hair unkempt is also disliked.
The four schools agree on this.
Explanation
The Prophet ﷺ said: whoever has hair should honour it. When he saw a man with messy, scattered hair, he asked whether the man could not find something to calm his hair with. Aisha said he liked to start from the right when combing his hair, and he parted it in the middle.
What the Sunnah includes. Wash it, comb it, oil it and keep it tidy. Oil and comb the beard too; see the Sunnah of the beard. Use a pleasant scent if you like.
Not too much. The Prophet forbade combing the hair except every other day, according to a hadith in Abu Dawud. The scholars understood this as discouraging excess: spending a lot of time on the hair every day for show. Brushing out tangles each morning to look decent is fine.
Oils and products. Natural oils like olive, coconut and black seed oil are popular, and any lawful product is fine. Avoid products with impure ingredients and pig-hair brushes; see boar bristle brushes. Gel, wax and thick creams that coat the hair should be washed out before ghusl.
Wudu and ghusl. In wudu, wiping a quarter of the head is enough even with oil in the hair. In ghusl, water must reach every hair and the scalp; see how to do ghusl. For length and style, see long hair.
The evidence
Quran, Surah Al-A'raaf 7:31
۞ يَٰبَنِىٓ ءَادَمَ خُذُوا۟ زِينَتَكُمْ عِندَ كُلِّ مَسْجِدٍۢ وَكُلُوا۟ وَٱشْرَبُوا۟ وَلَا تُسْرِفُوٓا۟ ۚ إِنَّهُۥ لَا يُحِبُّ ٱلْمُسْرِفِينَ ﴿٣١﴾
O children of Adam, take your adornment at every masjid, and eat and drink, but be not excessive. Indeed, He likes not those who commit excess.
Looking neat and groomed is encouraged, especially for prayer.
Sunan Abi Dawud 4163
Graded hasan sahih... من كان له شعر فليكرمه ...
"Whoever has hair, let him honour it."
Caring for the hair is encouraged.
Sunan Abi Dawud 4062
Grading to be checked... أما كان يجد هذا ما يسكن به شعره ...
"Could this man not find something to calm his hair with?"
Leaving the hair unkempt was disapproved.
Sahih al-Bukhari 168
Sahih... يعجبه التيمن في تنعله وترجله وطهوره ...
"He liked to start with the right in putting on his sandals, combing his hair and purifying himself."
Start combing from the right.
Sunan Abi Dawud 4159
Grading to be checked... نهى رسول الله صلى الله عليه وسلم عن الترجل إلا غبا ...
"The Messenger of Allah forbade combing the hair except every other day."
Grooming should not become excessive.
Where the ruling is recorded
- al-Fatawa al-Hindiyya, Kitab al-Karahiyya, chapter on circumcision, hair and nails. On caring for the hair of the head and the beard.
- al-Hidaya, Kitab al-Taharah, chapter on ghusl. Water must reach the roots of the hair in ghusl.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.