What oils did the Prophet Muhammad and the Imams use. Like hair oil and other parts.

In Arabic this is what those oils are called:

1- Banafsaj (most preferred by the Prophet (s) and Imams (a))

2- Zanbaq (aka Raziqi)

3- Khayri

4- Simsim (sesame)

You can find some of their names here:

https://www.al-islam.org/islamic-medical-wisdom-tibb-al-aimma/oil-violets