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 be drawn to someone / something like a moth to a flame.
This is used to describe a situation where a person is instinctively or very strongly attracted to someone or something. (Just as a moth is attracted to bright lights or flames.)
E.g. The bright lights of Hollywood are irresistible. Young actors are drawn to the city like moths to a flame.
To be like a rat up a drainpipe.
This is informal language used in a situation where a person moves very quickly and opportunistically.
E.g. He shot off like a rat up a drainpipe. (He got away very quickly.)
Have fun learning English!
Louise