anhaben
to have on
To be wearing an item of clothing.
Was hattest du gestern auf der Party an?
What did you have on at the party yesterday?

to have on / to harm
Loading your saved state.
to have on
To be wearing an item of clothing.
Was hattest du gestern auf der Party an?
What did you have on at the party yesterday?

'Anhaben' (to have on / to harm) is a separable verb made up of 'an' and 'haben' (to have). In a main clause, the prefix 'an' goes at the end. In subordinate clauses and in the infinitive, the verb stays together.
Er hatte bei der Feier einen eleganten Anzug an.
He had an elegant suit on at the celebration.
The expression 'jemandem etwas anhaben können' (to be able to harm someone) is almost always negated. It describes that a person is not affected by something negative. The person to whom nothing happens is always in the dative.
Der Regen konnte uns nichts anhaben, wir hatten gute Kleidung.
The rain couldn't harm us; we had good clothing.
In the meaning of 'Kleidung tragen' (to wear clothes), 'anhaben' (to have on) is used very often in spoken language, especially in questions.
Was hast du denn heute Schönes an?
What nice thing do you have on today?
The two meanings are easy to distinguish. When it is about clothing, an accusative object is often used (ein Kleid anhaben — to have a dress on). When it is about harm, a dative object is always used (jemandem nichts anhaben — to be unable to harm someone).
Sie hatte ein schönes Tuch an. (Kleidung)
She had a beautiful scarf on. (clothing)
to wear / carry
'tragen' and 'anhaben' can both mean that you have clothing on your body. 'tragen' is neutral and also works well for jewelry or glasses. It often sounds a bit more general or intentional, for example when talking about style. 'anhaben' is used mainly in everyday language for items of clothing that someone is wearing at the moment. Learners may confuse the words because both fit with clothing. Practically speaking: 'Was hast du an?' (What are you wearing?) sounds very natural in everyday life; 'Sie trägt ein schwarzes Kleid' (She is wearing a black dress) sounds neutral and a bit more precise.

In der Küche hat Emma noch ihre Jacke an.
Emma still has her jacket on in the kitchen.
Yusuf trägt heute eine neue Brille.
Yusuf is wearing new glasses today.