Bringing two different things together with an explicit word, such as "like", "just as" or "seems". Unlike metaphor, the comparison leaves in plain view that they are two things.
In The Death of Ivan Ilyich
he, like a moth to light, was drawn to the best-placed people in society, adopted their manners and their views of life, and formed friendships with them.
"Like a moth to light" compares Ivan Ilyich to the insect that throws itself at the lamp. The "like" puts the image in plain view, which suggests a blind attraction to the well-placed people and a risk he does not see.
Chapters I to III: The Wake and Life, the narrator
And is it true that here, on this curtain, I lost my life as in an assault? Can it be? How awful, and how stupid!
Chapters IV to VII: The Illness and the Lie, Ivan Ilyich
He wanted someone to pity him as if he were a sick child. He wanted to be caressed and kissed and wept over, as one caresses and comforts children.
Chapters IV to VII: The Illness and the Lie, the narrator
It was as if I were going down the mountain at a steady pace, imagining that I was climbing. And so it was. In public opinion I was climbing the mountain, and to the same degree life was slipping away beneath me... And now, there it is, he dies!
Chapters VIII to XII: Death, Ivan Ilyich
Subscription
The explanation of each passage, in every device and in every work, comes with a subscription.