A metaphor is when you say that anything is something it really isn't, in order to describe it.
For example, saying that the fog is a cat, or that life is a battle, is using metaphors. This tells people that the fog is a bit like a cat: grey, perhaps, and not waiting to be invited. Life is a bit like a battle because it's dangerous.
But if you say the fog is like a cat, or that life is like a battle, that's a simile rather than a metaphor. Metaphors and similes work rather similarly.