Similes, metaphors, and personification are all types of comparisons.
A simile compares to unlike things use like, as or sometimes than.
Her hair was as bright as the sun.
Her hair shone like beams of sunlight.
Her hair is being compared to sunlight, without saying that it is sunlight.
A metaphor compares two unlike things using a linking verb (such as is or was). Basically, while a simile says something is similar to something else, a metaphor describes something as if it is something else.
Her hair was rays of sunlight.
The sun on her head shone from across the room.
Her hair is becoming compared to sunlight by saying it actually is sunlight.
Personification is when something not human is described as human. Usually this is done by describing an inanimate or non-human object as you would a person.
Her hair smiled at me from across the room.
Hair cannot actually smile, but we get the sunny effect.