Sahl bin Sa'd As-Sa'idi (May Allah be pleased with him) reported:
A man came to the Prophet (ﷺ) and said, "O Messenger of Allah, guide me to such an action which, if I do Allah will love me and the people will also love me." He (ﷺ) said, "Have no desire for this world, Allah will love you; and have no desire for what people possess, and the people will love you."[Ibn Majah]
Arabic/English book reference: Book 1, Hadith 472