Abu' l-Abbas as-Sa'idi said :
“A man came to the Prophet (saws) and said, 'Oh Messenger of Allah! Guide me to such an action, that when I do it, Allah will love me and the people will love me. He said, be detached from this world and then Allah will love you and do not be attracted to what people have and then the people will love you''.
related by Hasan, ibn Majah kitab az-Zuhud 2/1373