Hit the hay is an idiomatic expression that is said when someone desires to signal that they are going to bed.
People use it when they are surrounded by a group of friends or family, usually when getting tired and meaning to express that they are no longer going to take part in social activities because of being tired and therefore going to sleep.
You can also use it to command others to go to sleep. This version is normally uttered to children, by their parents or their caretakers.
The term originates from American English, developed in the 19th and early 20th century, when people used straws of hay as a primary item to craft mattresses and beds, or other cushioned furniture.
Although in modern environments the usage of hay has disappeared, people kept the expression as an idiom to signal going to bed.
In 1994, the popular country band Rednex released a song which received the title Hittin’ The Hay, which further indicates the folk origins of the expression.
Hit the hay is also featured in various educational videos on YouTube, one of the earliest of which was uploaded by the channel SDictionary in 2015.