Both compare two different things. The difference is how they do it.
Simile
Compares two things using like or as.
Her eyes shone like stars.
He is as quiet as a mouse.
The baby slept like a log.
Metaphor
Says one thing is another. There is no like or as.
Her eyes were stars.
My little sister is a tornado.
The lake was a mirror.
Quick test
Do two different things get compared?
Is there a like or as making the comparison? If yes, it is a simile.
Does it simply say one thing is or was the other? Then it is a metaphor.
Careful:like and as are not always comparisons. “I like pizza” and “He works as a nurse” are not similes. Only a comparison between two different things counts.