There are many expressions commonly used in English to express similarity.
There is no magic rule to help you remember them. You just have to learn them. Sorry!
Take a look at the examples below.
To sleep like a log.
If you sleep like a log, you sleep very soundly (deeply) and cannot be woken up easily.
E.g. There was some turbulence on the flight so I couldn’t sleep very well but it didn’t bother my colleague. She slept like a log for the whole flight.
To fit like a glove.
If something fits like a glove, it is the perfect size and shape for someone.
E.g. This is my favourite suit. It fits like a glove and is so comfortable to wear.
Have fun learning English!
Louise