How can I get a hat? I've been playing for ages, and haven't got a darn tootin' thing.
While a real drop cannot be guaranteed, you can craft yourself a hat.
3 refined metals will craft into a random hat. 4 refined metals and a class token will craft a class-specific hat.
It takes two drops to create a scrap metal, three scrap metal to create a reclaimed metal, and three metal to make a refined metal. A class token is created by crafting three weapons of that class.
So for a random hat, it takes at minimum 54 items. For a class-specific hat it takes at minimum 75.
For more crafting detail, visit the official wiki.