Both are examples of figurative language, and compare one thing to another. However, whilst a simile states that X is like Y, a metaphor states that X is Y.eg. 'The sun was like a golden coin in the sky' vs 'The sun was a golden coin in the sky'The first is a simile, the second a metaphor