Lol the only way to prevent hat head is to not wear hats.
In all seriousness -- it depends on your hair. With hair like mine, that is naturally fluffy, hat head just happens. I can't prevent it. If I wore it long, I guess I could put it in a ponytail to minimize the appearance of the hat head, but the hat would still squash it down more than it should be squashed. If you have smooth hair that lies flat against your head, with no air between the strands, then the hat won't really do anything, I guess!
Toques (ski hats or beanies for non-Canadians) are by far the worst offenders in terms of hair-squashing.
ETA the other option is to leave the hat on all day (something I've done when I have short hair that's in need of a wash...)