What is the meaning of [Hit the sack]

Just like the first idiom, the literal meaning of this would be physically hitting or beating a sack (a large bag usually used for carrying things in bulk such as flour, rice or even soil). But actually to hit the sack means to go to bed, and you’d use this to tell your friends or family that you’re really tired, so you’re going to sleep.