Hit the hay and hit the sack are two idioms that mean to go to bed. The assumption is that hit the hay and hit the sack come from the fact that mattresses used to consist of cloth sacks stuffed with hay.