You will need a measuring tape. If there is none, then a thread is quite suitable, the length of which you measure with a ruler.
Measure the head circumference by passing the tape across the middle of your forehead and half an inch above your ears. The tape should not lie diagonally, but strictly horizontally around the head!
Make sure the band is neither too tight nor too loose, but in a way that you would be comfortable wearing the hat. If you are in between sizes, go for the larger size.