Many people confuse analogies, similes, and metaphors. Let me help.
Analogies compare things so that you can see a relationship between them. There are many ways to do it, but the key thing is comparing one thing to another.
Similes do this by saying something is “like” or “as” something else.
He’s like a wall.
She’s as smart as a whip.
Her temper was like a storm.
Metaphors do this by saying something “is” something else.
That test was murder.
The company was a sinking ship.
The campaign is a dumpster fire.
So, analogies are comparisons, and metaphors and similes are two ways to make them.