Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:31:18

And do not turn your cheek ˹in contempt˺ toward people and do not walk through the earth exultantly. Indeed, Allah does not like everyone self-deluded and boastful.  

And do not turn your cheek disdainfully from people (tusa‘‘ir: a variant reading has tusā‘ir) do not turn your face away in disdain, and do not walk upon the earth exultantly, in other words, with haughtiness. Truly God does not like any swaggering braggart, strutting in his step, ˹boasting˺ in front of people.
القرآن:٣١:١٨

وَلَا تُصَعِّرْ خَدَّكَ لِلنَّاسِ وَلَا تَمْشِ فِي الْأَرْضِ مَرَحًا ۖ إِنَّ اللَّهَ لَا يُحِبُّ كُلَّ مُخْتَالٍ فَخُورٍ  

{ولا تصعِّر} وفي قراءة تصاعر {خدك للناس} لا تمل وجهك عنهم تكبرا {ولا تمش في الأرض مرحا} أي خيلاء {إن الله لا يحب كل مختالٍ} متبختر في مشيه {فخور} على الناس.