I saw this phrase: "to look the horse in the mouth" and remembered that there are many more such phrases out there.
What are such constructions called and how do they function?
Never look a gift horse in the mouth
This is a common English aphorism that means, "Don't be too critical about gifts you receive". It's phrased as an imperative, so it's like a strong suggestion or command.
Many aphorisms are similarly phrased as imperatives:
Look before you leap. (Take reasonable precautions before you do anything risky)
Don't count your chickens before they hatch. (Don't assume an outcome before it actually happens)
If it ain't broke, don't fix it
When in Rome, do as the Romans do. (when in a different country or environment, act according to the customs and habits of that culture)
Don't judge a book by its cover. (don't assume superficial appearance tells you everything about something)
and various others. However you can phrase almost any statement as an imperative, if you want to use it as a request, command, or demand:
Look both ways before crossing the street!
Finish your vegetables, then you can have dessert!
and so on.