Vanity is the unnecessary obsession with what strangers think of you. A vain person seeks the approval of strangers. In the past, the approval of members of the public may have kept you alive. In modern society, social approval is valuable only instrumentally.
If you walk out in public, and strangers admire you: So what? Unless you are seeking sex or money from strangers, what does this approval get you? If it gives you a buzz, that is only because your brain has evolved to seek that buzz.
Therein lies the problem. Vanity has an evolutionary basis. Part of transcending our beastly origins is recognizing the needlessness of vanity.
Unless you need something from a stranger, what does their approval get you? Yet people seek the approval of strangers at great cost. How much money do people spend on clothing designed to impress strangers? How much time do people spend preparing to "go out in public"? As if it should matter!