Imām Ash-Shāfi’ī stated:

“You surely do not have the ability to please all of the people. Therefore, rectify that which is between you and Allah then (afterwards) don’t worry about (pleasing) the people.”

[Tawālī At-Ta-nīs of Ibn Hajar 168]